logstash-plugins / logstash-filter-grok

Grok plugin to parse unstructured (log) data into something structured.
https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html
Apache License 2.0
124 stars 98 forks source link

Add ability to match multiple regex groups into array #86

Open PhaedrusTheGreek opened 8 years ago

PhaedrusTheGreek commented 8 years ago

Not sure if this is already possible, but it doesn't seem so.

Given the String: Hello:1 Hello:2 Hello:3, In Perl, you could do: /Hello:(\d+)/g , with the Global modifier (/g), this would give you an array: [1,2,3]. But in Logstash/Ruby, there doesn't appear to be a way to add the global modifier.

Related SO discussion: http://stackoverflow.com/questions/3588931/ruby-global-match-regexp Related Logstash discussion: https://discuss.elastic.co/t/how-to-capture-regex-groups-with-g/55858