Each hit action (with mustache ? )

Hi,

trying to make 1 webhook per hit in 5.2. I test mustache (via or without inline painless line) at action level of a watch without success to replace an old transform of version 2.4

is it possible to have something like this (pseudo code)

{{#ctx.payload.hits.hits}}
   , "actions" : {
    "dummy_post" : {
      "webhook" : {
        "method" : "POST"
        , "url" : "http://My/Server/Page.pl"
        , "body" : "Ref: {{_source.record_number}} bla bla"
        }
      }
    }
{{/ctx.payload.hits.hits}}

inline painless seems no working at this level ( direct error)

"inline": "{{#ctx.payload.hits.hits}}, \"actions\" : {\"dummy_post\" : {\"webhook\" : {\"method\" : \"POST\", \"url\" : \"http://My/Server/Page.pl\", \"body\" : \"Ref: {{_source.record_number}} bla bla\"}}}{{/ctx.payload.hits.hits}}"

number of hit could be high, how can i evaluate the load (where to look limitation)

Hey,

you cannot execute a webhook per hit in order to prevent overloading. If you want to do it, you should use a single webhook, that sends data to logstash (using the http input) and then use logstash to send data to several endpoints.

--Alex

ok, thank you for the reply and explaination why.

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