Hello currently I have code that works, but could be improved if I would be able to iterate.
Now I say if the 3rd element of the array exists, output the 3rd element (into a file).
See code below:
output {
if [value][3] {
file {
path => "\\host123\input\file.txt"
codec => line { format => "name: '%{name[3]}' value: '%{value[3]}'" }
}
if [value][2] {
file {
path => "\\host123\input\file.txt"
codec => line { format => "name: '%{name[2]}' value: '%{value[2]}'" }
}
if [value][1] {
file {
path => "\\host123\input\file.txt"
codec => line { format => "name: '%{name[1]}' value: '%{value[1]}'" }
}
if [value][0] {
file {
path => "\\host123\input\file.txt"
codec => line { format => "name: '%{name[0]}' value: '%{value[0]}'" }
}
}