I'm trying to set up what I feel should be a very simple watcher process, but I am new to building queries and having a very hard time. I'd like to compare the "actual" value to the "typical" value from a machine learning "record". Both fields are type double (numbers).
I can't seem to find any examples of number fields being compared to build from. In my final watcher process I'd like to get an alert when the "actual" value is 4x or greater than the "typical" value. Any pointers would be greatly appreciated.
Here's output for the index being used for background on the query. Thanks.
".ml-anomalies-custom-k12_ddos_unique_src_networks_5min_avg": {
"aliases": {
".ml-anomalies-.write-k12_ddos_unique_src_networks_5min_avg": {},
".ml-anomalies-k12_ddos_unique_src_networks_5min_avg": {
"filter": {
"term": {
"job_id": {
"value": "k12_ddos_unique_src_networks_5min_avg",
"boost": 1
}
}
}
}
},
"mappings": {
"doc": {
"_meta": {
"version": "6.4.2"
},
"dynamic_templates": [
{
"strings_as_keywords": {
"match": "*",
"mapping": {
"type": "keyword"
}
}
}
],
"properties": {
"actual": {
"type": "double"
},
"typical": {
"type": "double"
}
}
}
},
"settings": {
"index": {
"number_of_shards": "5",
"translog": {
"durability": "async"
},
"auto_expand_replicas": "0-1",
"provided_name": ".ml-anomalies-custom-k12_ddos_unique_src_networks_5min_avg",
"query": {
"default_field": "all_field_values"
},
"creation_date": "1523485305115",
"unassigned": {
"node_left": {
"delayed_timeout": "1m"
}
},
"number_of_replicas": "1",
"uuid": "PUVrI9QVQf-sutll3wo6FQ",
"version": {
"created": "6020399"
}
}
}
}