Hi everyone,
I tried to use the split plugin for splitting an array into multiple events.
However, it seems that it's not capable of interpreting field like "%{type[1]}".
As entry, I use this kind of message (this is an example):
{
"host_sensor" => "10.0.2.1",
"@timestamp" => "2016-08-22T12:17:50.463Z",
"sensorsVegetablesTable" => [
{
"sensorVegetablesTemperature" => 21,
"sensorVegetablesHumidity" => 40,
"sensorVegetablesId" => "1111111"
},
{
"sensorVegetablesTemperature" => 24,
"sensorVegetablesHumidity" => 51,
"sensorVegetablesId" => "2222222"
}
],
"type" => "array.sensorsVegetablesTable",
"array_name" => "sensorsVegetablesTable"
}
Here is my logstash configuration file :
input {
...
}
filter {
mutate {
split => { "type" => "."}
}
# Want to split into multiple events split { field => "%{type[1]}" }
}
output {
stdout {
codec => rubydebug
}
}
As result, I have an error message : "LogStash::ConfigurationError: Only String and Array types are splittable. field:%{type[1]} is of type = NilClass"
What can I do for resolving this issue ? Does someone know if the split plugin is already working now ? (Because it doesn't seems to be well supported on Github).
Thank you
EDIT : JSON message has been modified (it was a ruby debug view)