# Nested for loop in logstash / calling logstash filters from ruby

**URL:** <https://discuss.elastic.co/t/nested-for-loop-in-logstash-calling-logstash-filters-from-ruby/259404>\
**Category:** Logstash\
**Created:** [December 22, 2020, 3:59pm UTC](https://discuss.elastic.co/t/nested-for-loop-in-logstash-calling-logstash-filters-from-ruby/259404 "2020-12-22T15:59:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aerodynamic](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@aerodynamic](https://discuss.elastic.co/u/aerodynamic)\
**Post date:** [December 22, 2020, 3:59pm UTC](https://discuss.elastic.co/t/nested-for-loop-in-logstash-calling-logstash-filters-from-ruby/259404/1 "2020-12-22T15:59:43Z")

</div>

Hello,

Currenly I'm dealing with a development roadblock to shorten a pipeline config.

The logic in any other programming language would be a nested for loop. An iteration over values on array A for each value in array B.

But the code I'm working on makes an explicit call for each combination. Leading me to have to develop with Regex. It's maddening.

I know there isn't a for loop option in logstash. But is there a way I can call a series of filters, or even a separate conf file, for each combination within the ruby plugin?

---

<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:** [January 19, 2021, 3:59pm UTC](https://discuss.elastic.co/t/nested-for-loop-in-logstash-calling-logstash-filters-from-ruby/259404/2 "2021-01-19T15:59:45Z")

</div>

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