Hi!
I wanted to ask here first before opening an issue in github as i am not %100 sure i am doing the correct thing.
I use the hosted elastic cloud from you. es version is 5.1.2
Utilizing the following mapping:
{
  "template": "infra_metrics-*",
  "settings": {
    "index": {
      "refresh_interval": "5s"
    }
  },
  "mappings": {
    "_default_": {
      "dynamic_templates": [
        {
          "strings": {
            "match": "*",
            "match_mapping_type": "string",
            "mapping":   { "type": "string",  "doc_values": true, "index": "not_analyzed" }
          }
        }
      ],
      "_all":            { "enabled": false },
      "_source":         { "enabled": true },
      "properties": {
        "timestamp":    { "type": "date",    "doc_values": true},
        "source_vm":     { "type": "keyword", "doc_values": true },
        "cpu_user_percentage":        { "type": "float",   "doc_values": true },
        "cpu_sys_percentage":         { "type": "float",   "doc_values": true },
        "cpu_wait_percentage":        { "type": "float",   "doc_values": true },
        "mem_percentage":         { "type": "float",   "doc_values": true },
        "ephemeral_disk_percentage":         { "type": "float",   "doc_values": true },
        "persistent_disk_percentage":        { "type": "float",   "doc_values": true },
        "system_disk_percentage":         { "type": "float",   "doc_values": true },
        "swap_percentage":         { "type": "float",   "doc_values": true }
      }
    }
  }
}
I create the following watch
{
    "trigger": {
        "schedule": {
            "interval": "5m"
        }
    },
    "input": {
        "search": {
            "request": {
                "indices": [
                    "infra_metrics-*"
                ],
                "body": {
                    "query": {
                        "bool": {
                            "filter": {
                                "range": {
                                    "timestamp": {
                                        "from": "now-5m",
                                        "to": "now"
                                    }
                                }
                            },
                            "should": [
                                {
                                    "range": {
                                        "cpu_sys_percentage": {
                                            "gte": 80.0
                                        }
                                    }
                                },
                                {
                                    "range": {
                                        "cpu_user_percentage": {
                                            "gte": 80.0
                                        }
                                    }
                                },
                                {
                                    "range": {
                                        "cpu_wait_percentage": {
                                            "gte": 80.0
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        }
    },
    "condition": {
        "compare": {
            "ctx.payload.hits.total": {
                "gt": 0
            }
        }
    }
I removed the last action part.
So what happens is that this watch executes and returns all the datapoints in the timestamp filter i applied.
Its like all the should ranges are ignored.
if i swap should with must the watch works as expected.
Am i doing something wrong? basically i want to trigger an email if one of these values go above 80.0
Thx,
Emir