# How to refer to the whole modified event inside http output plugin

**URL:** https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232
**Category:** Logstash
**Created:** [June 29, 2023, 5:15pm UTC](https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232 "2023-06-29T17:15:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [June 29, 2023, 5:15pm UTC](https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232/1 "2023-06-29T17:15:18Z")

</div>

I am trying to map my http payload and put the whole Logstash event inside another json key/field:

```auto
http {
  format => "json"
  http_method => "post"
  url => "some url"
  headers => ["some header"]
  mapping => {
    "field 1" => "value 1"
    "field 2" => "value 2"
    "event" => "I want my whole event to be exploded here, how can I do that? I tried %{source}, %{data} both don't work - how can I do this? "
  }
}

```

---

<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: [June 29, 2023, 10:46pm UTC](https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232/2 "2023-06-29T22:46:29Z")

</div>

If you really want the whole event (as a hash) then try

filter { ruby { code =\> 'event.set("[@metadata][event]", event.to\_hash)' } }  
output { http { mapping =\> { "event" =\> "%{[@metadata][event]}" ...

---

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [June 30, 2023, 6:23pm UTC](https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232/3 "2023-06-30T18:23:38Z")

</div>

That worked! Huge thanks to you Mr @Badger, you are the best mustelid in the world!

---

<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: [July 28, 2023, 6:23pm UTC](https://discuss.elastic.co/t/how-to-refer-to-the-whole-modified-event-inside-http-output-plugin/337232/4 "2023-07-28T18:23:40Z")

</div>

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