I am using a kv filter to split an event message of comma separated values on the coma character to create a string array fa and saving a specific array element as a field as follows
filter {
kv { # Split comma separated data into an array (fa).
field_split => ","
source => "message"
target => "fa"
}
mutate {
add_field => { "server-name" => "%{fa[3]}" }
}
...
}
This always generates the litteral text "%{fa[3]}" as the server-name field value rather than the contents 4th element in the fa array. Please can someone tell me what I am doing wrong?
Later on in an output filter I can embed "%{fa[3]}" in a string to export the same array element to a file using the sprintf forma.. Please can someone tell me what am I missing above?
Logstash version = 5.2.2