# How to send multiple headers in Logstash http output plugin?

**URL:** https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318
**Category:** Logstash
**Created:** [December 10, 2020, 6:30pm UTC](https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318 "2020-12-10T18:30:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)
#### Post date: [December 10, 2020, 6:30pm UTC](https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318/1 "2020-12-10T18:30:12Z")

</div>

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](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.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [December 10, 2020, 6:32pm UTC](https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318/2 "2020-12-10T18:32:26Z")

</div>

> [@elasticheart](#):
>
> Is this the correct way?

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.

---

<div class="post-metadata">

### Author: ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)
#### Post date: [December 10, 2020, 6:45pm UTC](https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318/3 "2020-12-10T18:45:07Z")

</div>

Thanks @Badger for your support

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 7, 2021, 6:45pm UTC](https://discuss.elastic.co/t/how-to-send-multiple-headers-in-logstash-http-output-plugin/258318/4 "2021-01-07T18:45:11Z")

</div>

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