我正在尝试保存 kibana 仪表板 - 我尝试了常规保存以及保存到文件选项。在任何一种情况下,我都无法打开相同的仪表板 - 我在顶部看到的错误如下:
错误提示
No time filter Timestamped indices are configured without a failover. Waiting for time filter
Run Code Online (Sandbox Code Playgroud)
在保存仪表板之前,我可以在 kibana 中正确查看日志。任何有关故障排除或修复此问题的想法将不胜感激。
我有一个小python程序,我用它来操作JSON文件.我发现当我使用json.dump()将操纵数据转储回JSON文件时,它会更改为<type 'NoneType'>.以下数据的原始类型(类型json_data)是<type 'dict'>.我将这些JSON文档存储在elasticsearch中,并使用Kibana4将其可视化.Kibana4将新添加的整数字段视为字符串.有人曾经遇到过这个问题.
import json
fname = "json_data.txt"
with open(fname, 'r+') as f:
json_data = json.load(f)
print(type(json_data))
#Code to add fields to json files.
f.seek(0)
x = json.dump(json_data,f,ensure_ascii=True)
print(type(x))
Run Code Online (Sandbox Code Playgroud) 我正在使用 elasticsearch REST API 添加一些要在 kibana 仪表板中使用的数据。我有这种格式的时间戳2015-08-04 10:13:14。这种格式似乎与 kibana 不兼容。
有什么方法可以将它转换为类似 logstash 时间戳 (2015-08-04T10:13:14.000Z) 或任何其他解决方案来让 kibana 解决这个问题?
根据https://www.elastic.co/guide/en/shield/current/kibana.html,我需要设置
server.ssl.key: /path/to/your/server.key
server.ssl.cert: /path/to/your/server.crt
Run Code Online (Sandbox Code Playgroud)
我在哪里可以找到 Windows 环境中密钥和证书的路径?或者我应该如何制作一个并找到密钥和路径?
我使用Bulk API将数据导入ELK堆栈.
{"index":{"_index":"waf","_type":"logs","_id":"325d05bb6900440e"}}
{"id":"325d05bb6900440e","country":"US","ip":"1.1.1.1","protocol":"HTTP/1.1","method":"GET","host":"xxxxx","user_agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36","uri":"/?a=><script>alert(1)</script>","request_duration":1999872,"triggered_rule_ids":["100030"],"action":"challenge","cloudflare_location":"unknown","occurred_at":"2017-01-23T17:38:58.46Z","rule_detail":[{"id":"","description":"ARGS:A"}],"rule_message":"Generic XSS Probing","type":"waf","rule_id":"100030"}
Run Code Online (Sandbox Code Playgroud)
我在数据中有一个ip,我想使用GEOIP插件转入经度和纬度.
我创造了一个pipleine:
PUT _ingest/pipeline/geoip-info
{
"description": "Add geoip info",
"processors": [
{
"geoip": {
"field": "ip",
"target_field": "client_geoip",
"properties": ["location"],
"ignore_failure": true
}
}
]
}`
Run Code Online (Sandbox Code Playgroud)
然而,当我导入数据管道被忽略时,有人可以解释我如何修改批量API以通过管道传递信息,以便为我添加long和lat来创建地图.
谢谢
我想过滤掉Too many connectionsLogMessage 字段中存在的所有文档。
我写的查询是:
'
{
"query": {
"bool": {
"must": {
"match": {
"logType": "Error"
}
},
"must_not": {
"match": {
"LogMessage": ".*Too many connections.*"
}
}
}
}
}'
Run Code Online (Sandbox Code Playgroud)
另一方面,如果我在LogMessage现场使用我的整个字符串,它工作正常。
我在这里验证了我的正则表达式:
https://regex101.com/r/EexTmV/1
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题。
因此,我想为聚合部分的“内部”部分的聚合过滤器添加更多过滤器。我需要添加的另外两个过滤器位于查询部分。我能够让这段代码正常工作,它只需要将第二个和第三个嵌套过滤器从第一部分添加到聚合区域中,我目前仅通过“givingMatch.db_type”术语进行过滤。
这是当前只需要添加额外过滤器的代码:
GET /testserver/_search
{
"query": {
"bool": {
"filter": [
{
"nested": {
"path": "givingMatch",
"query": {
"bool": {
"filter": {
"terms": {
"givingMatch.db_type": [
"FECmatch",
"StateMatch"
]
}
}
}
}
}
},
{
"nested": {
"path": "givingMatch",
"query": {
"bool": {
"filter": {
"range": {
"givingMatch.Status": {
"from": 0,
"to": 8
}
}
}
}
}
}
},
{
"nested": {
"path": "givingMatch",
"query": {
"bool": {
"filter": {
"range": {
"givingMatch.QualityScore": {
"from": 17
}
} …Run Code Online (Sandbox Code Playgroud) "kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"4eb9f840-3969-11e8-ae19-552e148747c3\",\"filter\":[],\"query\":{\"language\":\"lucene\",\"query\":\"\"}}"
}
Run Code Online (Sandbox Code Playgroud)
上面提到的片段是 Kibana 可视化的导出 JSON。如果不导出此 json,是否有直接获取此
\"index\":\"4eb9f840-3969-11e8-ae19-552e148747c3\索引 ID 的方法。如果我没有错,这应该是索引 id,因为它在具有相同索引的可视化中很常见。
我正在尝试执行一个查询,其中我想要基于两个值的文档 - 名称(字符串)和百分比(数字)。示例是 - 我想要那些具有 "audience.location.countries.name" = "US" 和 "audience.location.countries.percentage" > 60 的文档。所以我想要一个具有对象 {"name": "US", "percentage":"65"} 这里,"audience.location.countries" 是一个具有两个属性的对象数组 - {"name","percentage"}。这是一个示例文档:
"location": {
"countries": [
{
"name": "CA",
"percentage": 4
},
{
"name": "GB",
"percentage": 5
},
{
"name": "JP",
"percentage": 8
},
{
"name": "US",
"percentage": 60
}
]}
Run Code Online (Sandbox Code Playgroud)
这是我尝试过的查询,但它引发错误:“[和] 查询格式错误,查询名称后没有 start_object”
GET opensponsorship/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"isPublic": true
}
},
{
"term": {
"isDeleted": false
}
},
{
"and":[
{
"range": { …Run Code Online (Sandbox Code Playgroud) 如果我想返回所有具有空属性 ( IMG)的文档,我可以执行以下操作:
GET something/_search/?
{
"query": {
"term": {"IMG": ""}
}
}
Run Code Online (Sandbox Code Playgroud)
它有效,因为IMG是关键字。如果我想要精确的 inverse,这意味着获取所有IMG不为空的文档,我应该输入什么?是否有term查询的“逆” ?
换句话说,Elasticsearch 有没有办法获取属性不为空的文档?