嗨,我想检查我的 kibana 日志中是否存在特定的字符串集,如果存在,那么我想创建警报
For Example My Pattern Hello World
and Request is Welcome to Hello World then trigger me alert
and Request is like Welcome to World then not trigger an alert
如何在 kibana 规则部分中完成它
您应该使用 match_phrase 查询来匹配
"Hello World"
但不匹配 "World"
。
您可以通过rules或watcher获取警报。要使用规则或观察程序,您应该订阅。您有 Elastic 许可证吗?或者您的 Elasticsearch 托管在 Elastic Cloud 中吗?
如果您在 discovery 中搜索
Hello World
,这将是一个 multi_match 查询,并且包含 hello
或 world
的文档将匹配。但是,如果您搜索 "Hello World"
,则只有完全具有 hello world
的文档才会匹配,因为它将使用 type: phrase
Kibana 中的观察者部分。
{
"query": {
"match": {
"your_field": "Hello World"
}
}
}
查看并保存您的观察者规则。