See aggregation value in a custom threshold (using webhook)

Hello all,

I have created a custom threshold rule in Kibana 8.15.3 where I have defined two aggregations:

Aggregation A --> count (all documents)
Aggregation B --> count (eventType: F*)

I have also created a webhook action where I can specify in the body some things like {{context.group}}, {{context.value}}, etc., but I can't find any instruction to show the value of the aggregations independently.

Does anybody know if I can show in the webhook body the value of the aggregation A or B separately and not only the calc done with the aggregations in the condition (condition that I can currently see using {{context.value}} instruction)?

Many thanks in advance.
Best regards.

Hola Juan,

Could you please try to use below :

ctx.payload.hits.total
ctx.payload.aggregations.<replace_with_your_agg_name>.doc_count

Thanks!!

Hi,

I have tried to use {{ctx.payload.hits.total}} and {{ctx.payload.aggregations.A.doc_count}} (because A is the aggregation where I have the all documents count) in the webhook body, but I can't see any value.

Anyway, many thanks for your help @Tortoise!!!