Watcher with Json body

I am using the watcher to send post request to webhook listener ,but I am failing to convert output array into json object .

"actions": { "send_alert_to_jumpstart_server": { "webhook": { "scheme": "http", "host": "*****", "port": 4455, "method": "post", "path": "/webhook", "params": {}, "headers": { "Authorization": "Bearer your_token", "Content-Type": "application/json; charset=UTF-8" }, "body": """ [ {{#ctx.payload.hits.hits}} { "timestamp" : "{{_source.@timestamp}}","cluster_name": "{{_source.cluster_id}}","gNBId" : "{{_source.gNBId}}"}, {{/ctx.payload.hits.hits}} ] """ } } },

BUT,
We are getting below error while executing watcher.
body": "\n400 Bad Request\n

Bad Request

\n

Failed to decode JSON object: Expecting value: line 5 column 9 (char 345)

\n"

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.