我为logstash编写了一个.conf文件,但我不熟悉ruby语法。
我收到错误 -
Ruby exception occurred: undefined local variable or method `?' for #
<LogStash::Filters::Ruby:0x2bfd7049>
有人可以指出错误吗?
这是我的代码
input {
file
{
path=> "/Users/Work/logs/sample.log"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter
{
ruby {
code => "
fieldarr=event.get('message').split(‘&’)
for field in fieldarr
result=field.split('=')
event.set(result[0],result[1])
end
"
}
}
output
{
elasticsearch {
codec=>rubydebug
hosts=> ["localhost:9200"]
}
}