I have an elastic search cluster with multiple indexes for example
Index A:
{
temperature: value,
hysteresis: value,
}
...
Index B:
{
door: value,
level:value
}
i am using kibana alert plugin for generating alert and then notify.
i want to generate alert if temperature and hysteresis value grater than 75 and door value 0 (temp>=75 and hysteresis>=75 and door =0 )
.I tried with following is my monitor query
{
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"range": {
"timestamp": {
"from": "{{period_end}}||-1m",
"to": "{{period_end}}",
"include_lower": true,
"include_upper": true,
"format": "epoch_millis",
"boost": 1
}
}
},
{
"range": {
"door": {
"from": null,
"to": 1,
"include_lower": false,
"include_upper": true,
"boost": 1
}
}
}
]
}
},
{
"bool": {
"must": [
{
"range": {
"timestamp": {
"from": "{{period_end}}||-1m",
"to": "{{period_end}}",
"include_lower": true,
"include_upper": true,
"format": "epoch_millis",
"boost": 1
}
}
},
{
"range": {
"temperature": {
"from": 70,
"to": null,
"include_lower": false,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"Hysteresis": {
"from": 75,
"to": null,
"include_lower": false,
"include_upper": true,
"boost": 1
}
}
}
]
}
}
]
}
}
}
it hit either door condition or temp or hysteresis condition match in one minutes.
I want monitor query hit if condition(temp>=75 and hysteresis >=75 and door =0 ) match in one minute.
I tried replacing "should" with "must" but it gives nothing.
How to write monitor query for multiple index