# Is it possible to access the whole logstash event as a variable in filters/outputs?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-access-the-whole-logstash-event-as-a-variable-in-filters-outputs/60090>\
**Category:** Logstash\
**Created:** [September 8, 2016, 3:46pm UTC](https://discuss.elastic.co/t/is-it-possible-to-access-the-whole-logstash-event-as-a-variable-in-filters-outputs/60090 "2016-09-08T15:46:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vangap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vangap/32/44927_2.png) [@vangap](https://discuss.elastic.co/u/vangap)\
**Post date:** [September 8, 2016, 3:46pm UTC](https://discuss.elastic.co/t/is-it-possible-to-access-the-whole-logstash-event-as-a-variable-in-filters-outputs/60090/1 "2016-09-08T15:46:27Z")

</div>

I wan to change the structure of the event that gets used in the output.

I want to generate soem think like this  
newevent = {"custom\_field" =\> 123, "data": event}

I can achieve this by using the ruby filter, but I want to know if there is a more elegant logstash way of doing this?  
Can we reference the event as a whole at all?

Thanks.

---

<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 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/is-it-possible-to-access-the-whole-logstash-event-as-a-variable-in-filters-outputs/60090/2 "2017-07-06T04:39:12Z")

</div>


