Logstash redis filter goes wrong

Hello, everybody,

i have the following error messages in the plain-logstash.log
Ruby exception occurred: undefined method `[ ]' for #LogStash::Event:0x671fe060

The filter that causes this problem looks like this

filter {
split {

}
ruby {
code => "fields = event['message'].split(':')
event[fields[0]] = fields[1].to_f"
}
}

Does anyone have an idea what I'm doing wrong or how I can fix this mistake?

kind regards, Thomas

Unless you are running a very old version of logstash you cannot refer to the event like that. If you want to add a field to the event use the event.set API.

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