# How to access newly created custom events from logstash filter?

**URL:** https://discuss.elastic.co/t/how-to-access-newly-created-custom-events-from-logstash-filter/27955
**Category:** Logstash
**Created:** [August 24, 2015, 2:26pm UTC](https://discuss.elastic.co/t/how-to-access-newly-created-custom-events-from-logstash-filter/27955 "2015-08-24T14:26:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ankmathur14](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@ankmathur14](https://discuss.elastic.co/u/ankmathur14)
#### Post date: [August 24, 2015, 2:26pm UTC](https://discuss.elastic.co/t/how-to-access-newly-created-custom-events-from-logstash-filter/27955/1 "2015-08-24T14:26:01Z")

</div>

Hi,  
I have created four custom events from a single original event in the ruby { } plugin of filter { }.  
I dropped the original event ( event.cancel ).

I used yield LogStash::Event.new(data) to create new events.

Now, How do i access these four newly created custom events in the filter { } for further processing.  
I mean what name to use for the new event. (like "event" for original event).  
These new events go perfectly to output { } but how do i access these events in filter { } after creating them.

Thanks.

---

<div class="post-metadata">

### Author: ![CraigFoote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigfoote/32/4571_2.png) [@CraigFoote](https://discuss.elastic.co/u/CraigFoote)
#### Post date: [October 17, 2016, 3:17pm UTC](https://discuss.elastic.co/t/how-to-access-newly-created-custom-events-from-logstash-filter/27955/2 "2016-10-17T15:17:48Z")

</div>

Hi Ankur, I'm trying to do something similar. Can you post your ruby filter code please?

Craig

---

<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:33am UTC](https://discuss.elastic.co/t/how-to-access-newly-created-custom-events-from-logstash-filter/27955/3 "2017-07-06T04:33:55Z")

</div>


