# Using HTTP output plugin and mapping tag

**URL:** https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278
**Category:** Logstash
**Created:** [April 10, 2019, 6:25pm UTC](https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278 "2019-04-10T18:25:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cyxop](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cyxop](https://discuss.elastic.co/u/cyxop)
#### Post date: [April 10, 2019, 6:25pm UTC](https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278/1 "2019-04-10T18:25:47Z")

</div>

I am adding fields to event using  
mutate { add\_field }

When I try to ship it adding event in mapping, I get an error:

> http {  
> http\_method =\> "post"  
> url =\> "[http://endpoint](http://endpoint)"  
> mapping =\> {  
> "event" =\> "%{event}"  
> "sourcetype" =\> "logstash"  
> }  
> }

If I do not add event - nothing comes accross

---

<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: [April 10, 2019, 7:24pm UTC](https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278/2 "2019-04-10T19:24:32Z")

</div>

What error do you get? What does the event look like if you use?...

```
output { stdout { codec => rubydebug } }
```

---

<div class="post-metadata">

### Author: ![cyxop](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cyxop](https://discuss.elastic.co/u/cyxop)
#### Post date: [April 10, 2019, 8:21pm UTC](https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278/3 "2019-04-10T20:21:16Z")

</div>

I see output when I use rubydebug and assign every value inside the event like this:

> output {  
> http {  
> http\_method =\> "post"  
> url =\> "[http://myurl](http://myurl)"  
> mapping =\> {  
> "event" =\> {  
> "message" =\> "%{MESSAGE}"  
> "cluster" =\> "MY\_CLUSTER"  
> }   
> }  
> }  
> stdout {  
> codec =\> rubydebug  
> }  
> }

But when I try to pass original message like this - I get an error:

> output {  
> http {  
> http\_method =\> "post"  
> url =\> "[http://myurl](http://myurl)"  
> mapping =\> {  
> "event" =\> "%{event}"  
> "cluster" =\> "MY\_CLUSTER"  
> }  
> }  
> stdout {  
> codec =\> rubydebug  
> }  
> }

---

<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: [May 8, 2019, 8:34pm UTC](https://discuss.elastic.co/t/using-http-output-plugin-and-mapping-tag/176278/4 "2019-05-08T20:34:03Z")

</div>

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