Hay all
I am trying to get my head around customise the body of an webhook so instead of just ctx i like to out put for example
{
"name":"ctx.name",
"date trigger":"ctx.date",
"event level": "ctx.evlevel"
}
thanks in advance
Hay all
I am trying to get my head around customise the body of an webhook so instead of just ctx i like to out put for example
{
"name":"ctx.name",
"date trigger":"ctx.date",
"event level": "ctx.evlevel"
}
thanks in advance
Hey,
the correct way would be to create that object (as a hashmap) in a script via a transform
and then use "body":"{{#toJson}}ctx.my_object{{/toJson}}"
in the watch action.
See https://www.elastic.co/guide/en/elastic-stack-overview/6.6/actions-webhook.html and https://www.elastic.co/guide/en/elasticsearch/reference/6.6/search-template.html
hope this helps!
--Alex
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.