# Split function in ruby filter

**URL:** https://discuss.elastic.co/t/split-function-in-ruby-filter/134538
**Category:** Logstash
**Created:** [June 5, 2018, 6:52am UTC](https://discuss.elastic.co/t/split-function-in-ruby-filter/134538 "2018-06-05T06:52:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Shivom\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@Shivom\_Kumar](https://discuss.elastic.co/u/Shivom_Kumar)
#### Post date: [June 5, 2018, 6:52am UTC](https://discuss.elastic.co/t/split-function-in-ruby-filter/134538/1 "2018-06-05T06:52:51Z")

</div>

i want to use spilt function in ruby to split one list into two arrays. however there are some type of values that i want to ignore based on some regex.  
i have defined some regex in patterns dir of logstash. can someone please tell me how to access those regex in ruby filter. i am able to get those regex in grok filter by adding this line  
patterns\_dir =\> ["/etc/logstash/patterns"]

but i dont know how to do the same for ruby filter. if i am adding the same line in ruby filter then logstash is giving error.

---

<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 3, 2018, 6:52am UTC](https://discuss.elastic.co/t/split-function-in-ruby-filter/134538/2 "2018-07-03T06:52:51Z")

</div>

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