Iterate through data in field logstash

Hi all
I have a field like this

field: 10, 20, 30, 40

now that i want to make each of the data in the field to be parse like this:

field.1: 10
field.2: 20

and then use the translate plugin on each of these field.
Can some one help me with this problems.
also the number of data in the field are not always constant.


I would use ruby. Something like

ruby {
    code => '
        field = event.get("field")
        if field and field.is_a? Array
            field.each_index { |x|
                event.set("field.#{x+1}", field[x])

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