Hi,
I'm monitoring the log alarm through Kibana.
But there is a problem.
There are times when the alarm doesn't come from Kibana.
When I checked if there was no log, it was there.
The alarm is set to activate once a minute, and the trigger condition is ctx.results[0].hits.total.value > 0.
The alarm setting is as follows.
{
"size": 1,
"query": {
"bool": {
"must": [
{
"match": {
"message": {
"query": "Success",
"operator": "AND",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"match": {
"message": {
"query": "Version",
"operator": "AND",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"match": {
"beat.hostname": {
"query": "nms",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"match": {
"source": {
"query": "nms-oplog",
"operator": "AND",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"range": {
"@timestamp": {
"from": "{{period_end}}||-2m",
"to": "{{period_end}}",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
}
],
"must_not": [
{
"match": {
"connection_node": {
"query": "x-osp-*",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"@timestamp": {
"order": "desc"
}
}
]
}
The picture below shows that there was a real log.
I changed the range from {{period_end}}||-2m to {{period_end}}||-5m just in case, but it was useless.
I can't switch log monitoring to Kibana because this problem keeps happening.
Please give me some ideas to fix this problem.