Hi.
I have tested with this query:
"{
"size": 2,
"query": {
"bool": {
"must": [
{
"match": {
"
rule.id": {
"query": "502",
"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
}
}
}
],
"filter": [
{
"range": {
"timestamp": {
"from": "now-1d",
"to": "now",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}"
And the mustache message template you shared:
"Monitor {{
ctx.monitor.name}} just entered alert status. Please investigate the issue.
- Trigger: {{
ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Period end: {{ctx.periodEnd}}
- Occurrences: {{ctx.results.0.hits.total.value}}
{{#ctx.results.0.hits.hits}}
- Rule: {{_source.rule.description}}
{{/ctx.results.0.hits.hits}}"
In the "Preview message" section of the Alerting Monitor configuration I see the correct message:
"Monitor test just entered alert status. Please investigate the issue.
- Trigger: test
- Severity: 1
- Period start: 2024-12-18T14:18:46Z
- Period end: 2024-12-18T14:19:46Z
- Occurrences: 6
- Rule: Wazuh server started.
- Rule: Wazuh server started."
Also, the notification that I receive is correct:
"Monitor test just entered alert status. Please investigate the issue.
- Trigger: test
- Severity: 1
- Period start: 2024-12-18T14:18:33.006Z
- Period end: 2024-12-18T14:19:33.006Z
- Occurrences: 6
More Information
- Rule description: Wazuh server started.
- Rule description: Wazuh server started."
I see that the message you are getting does not match with the mustache template, not even the harcoded string part of the message. Do you have another alert/monitor configured that can be sending that notification?