# Best practise method to split events and perform filtering to those events

**URL:** https://discuss.elastic.co/t/best-practise-method-to-split-events-and-perform-filtering-to-those-events/67115
**Category:** Logstash
**Created:** [November 24, 2016, 1:50pm UTC](https://discuss.elastic.co/t/best-practise-method-to-split-events-and-perform-filtering-to-those-events/67115 "2016-11-24T13:50:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jdmac](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jdmac](https://discuss.elastic.co/u/jdmac)
#### Post date: [November 24, 2016, 1:50pm UTC](https://discuss.elastic.co/t/best-practise-method-to-split-events-and-perform-filtering-to-those-events/67115/1 "2016-11-24T13:50:23Z")

</div>

Hi All,

I'm trying to do something that I'm not seeing an easy way to do and I'm not all that familiar with Ruby, so I'd prefer to use standard filters when/where possible.

Here's the scope of what I'm trying to achieve.

I receive a collectd-snmp polled event for IF-MIB::ifInOctets/IF-MIB::ifOutOctets into Logstash (2.4.1).

The event comes in with fields dstypes, dsnames and values which are all arrays and match up.

An example of the event fields mentioned would be:

dsnames = ['rx','tx']  
dstype = ['derive','derive']  
values = ['481752','12852']

What I'd like to achieve is splitting this into one event per array entry, ending up with:

Split off event #1  
dsname = rx  
dstype = derive  
value = 481752

Split off event #2  
dsname = tx  
dstype = derive  
value = 12852

Original event canceled.

On top of that, I then want to add a new field to each event which is the value \* 8 (to get bits instead of bytes).

Is this all actually achievable using standard filters (Logstash 2.4.1), or must I have to use a ruby filter?

Many thanks,  
jdmac

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [November 29, 2016, 9:22pm UTC](https://discuss.elastic.co/t/best-practise-method-to-split-events-and-perform-filtering-to-those-events/67115/2 "2016-11-29T21:22:00Z")

</div>

I don't think there's a way of doing this without a ruby filter.

---

<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: [December 27, 2016, 9:22pm UTC](https://discuss.elastic.co/t/best-practise-method-to-split-events-and-perform-filtering-to-those-events/67115/3 "2016-12-27T21:22:04Z")

</div>

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