I try to build a simple Hipchat notification by using webhooks. If I use simple static messages my notifications arrive. How do I create a JSON payload body with mustache? I tried the follwing configuration:
Oh I figured out my problem... The message is empty because there is no field total_hits. Your documentation contains many errors. But there is no Edit Button as in your open source products.
If I use "body" : "{ \"message\": \"{{ctx.payload.hits.total}}\" }" it's works fine except for the ugly escaped JSON string syntax.
I have the same issue with not being able to deserialize the data in the web server code. I tried @GaelTadh and I did notice a difference with my body code and I can see how that code would work with a single param like the total hits.
My issue however is that I am looking at sending the records that came back in the search as I need to extract some information out of each document and perform some tasks on each one. Is there a way to JSONify the search results to accomplish this? Or is there a better way to do this via a transform or script?
I have the exact same question as Pransh. Can someone please answer it? The webhook data is not returning as JSON and I want to know why and what can be done about it. Otherwise, I will need to create a script to do the conversion, but that should be an unnecessary step in the pipeline.
please open new subjects instead of reviving old threads - a lot has changed since almost one and a half years
First, if the data returned is not JSON, and you want to it to be JSON you need to convert it.
Since Elasticsearch 2.4 there is an additional mustache helper handler called toJson, which may help you.
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.