Detections with custom query

Hi @Anabella_Cristaldi,

Appreciate the sample :pray: thank you!

I do not see why is working for threshold but not for custom query (Does they have a different mechanism for quering)?

Yes, they do have different mechanisms. The threshold one is an aggregation and it does not fill in all the values when it creates a signal.

So, some good news is that in the soon to be released 7.10.0 where we improved error handling you will begin to see errors on that rule where before you were not. I just test ran that sample document off of Kibana master and here is the error:

It's pointing to your data set at host:

"host" : "srv",

Which has a conflict with the signal mapping. host has to be an object with inner objects/attributes as outlined here:

Once you fix that and re-index your data it should work. If it doesn't we can look at your mapping and data again. When the soon to be released 7.10.0 ships you will be able to see these error messages so getting these problems fixed sooner will be easier.

You can see the signals mapping here if it helps to find conflicts:

We mostly use ECS tooling fwiw:

and/or look at their generated outputs:
https://github.com/elastic/ecs/blob/master/generated/elasticsearch/7/template.json#L1071

to try and stay compliant and update along the way.