Dissecting an array of variable length

Hi there

I am trying to dissect an array of variable length. That means it can contain up to 5 entries.
Using the dissect plugin however requires me to indicate a fixed length and results in an [0] "_dissectfailure" return.
Is there any way to do this?

Best Michael

Examples:

The array:
"POI_array2_translated2" => [
[0] "Gandeggh?tte (3'030 m)$Bergh?tte mit Restaurant, Aussichtsterrasse und ?bernachtungsm?glichkeit (?ffnungszeiten beachten)$POIS49.jpg",
[1] "Trockener Steg (2'929 m)$Bergstation mit Shop, Restaurant und Aussichtsterrasse$POIS153.jpg"
]

The dissect plugin:
dissect {
mapping => {
"POI_array2_translated2" => "%{POI1_translated}, %{POI2_translated}, %{POI3_translated}, %{POI4_translated}, %{POI5_translated}"
}
}

dissect will not work. You can do it in ruby

    ruby {
        code => '
            a = event.get("POI_array2_translated2")

            if a then
                a.each_index { |i|
                    event.set("POI#{i+1}_translated", a[i])
                }
            end
        '
    }

Dear Badger
This works. Thanks a lot
Michael

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