How to send multiple headers in Logstash http output plugin?

Hi,

I am using Logstash 7.8.0. I am trying to send some message to an http endpoint using POST. I would like to add 3 header parameters and I would like to know how to do that. Its mentioned in the docs that its a hash https://www.elastic.co/guide/en/logstash/7.8/plugins-outputs-http.html#plugins-outputs-http-headers , and I tried this way;

output {
    http {
        headers => {
            header1 => "value1"
            header2 => "value2"
            header3 => "value3"
        }
    }
}

Is this the correct way? Thanks.

Yes, but you should put double quotes around the header names. If they are just letters and numbers it may work without quote, but if they contain punctuation (like _ or -) then I would expect a syntax error.

Thanks @Badger for your support

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