Hi all,
I was wondering, is there any way to take an array of matching values out of Grok plugin. let's explain more with an example:
I have a message like "message" = "whatever 0.0.0.0 whatever 1.1.1.1 something 2.2.2.2 ending"
As we can see I have in this example 3 IPs where it can be no IP or n of them. What I am looking for is using something like this %{IPS:ips} and get all IPs in an array in the result.
In general, this is the default behavior of the grok filter. If you have multiple patterns referring to the same field, it will insert all found values to it as an array.
But if you're looking for recursive patterns, which I assume you do given you mention you don't know beforehand the amount of repetitions you'll get, there are 2 avenues:
If you know the max amount of occurrences, put as many pattern repetitions in your grok pattern and make them optional as grok does not support recursion currently, or
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.