我目前正在尝试将以下逻辑放入ES查询中-是吗 http_code 是否存在?如果是这样,它应该在400-600之间,但也可能丢失。
http_code
下面的查询不起作用,我认为需要修改和更正。
{ "query": { "bool": { "must": [ { "range": { "http_code": { "gte": 400, "lt": 600 } } }, { "bool": { "should": [ { "bool": { "must_not": { "exists": { "field": "http_code" } } } } ] } } ] } } }
最初的要求是在 基巴纳 仪表板范围400-600或丢失。
要进行您建议的查询,需要执行以下操作:
The original requirement is to save a filter in a Kibana dashboard with range 400-600 OR it's missing. as:
{ "query": { "bool": { "minimum_should_match": 1, "should": [ { "range": { "http_code": { "gte": 400, "lt": 600 } } }, { "bool": { "must_not": { "exists": { "field": "http_code" } } } } ] } } }