lea*_*ner 1 curl elasticsearch kibana
我想过滤掉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)
请帮我解决这个问题。
您需要使用regexp查询而不是match查询
{
"query": {
"bool": {
"must": {
"match": {
"logType": "Error"
}
},
"must_not": {
"regexp": {
"LogMessage": ".*Too many connections.*"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4294 次 |
| 最近记录: |