我正在登录logstash 我的日志格式如下:
timestamp key=val key2=val2 ..<a list of key=val>.. [log-level] the rest of the message
示例:
17:21:20.470 pid=<0.20592.0> app=myapp key1=val.1 key2=val/2 [info] my message blabla
我想将它们解析为这种格式:
{
"timestamp" => "17:21:20.470",
"pid" => "<0.20592.0>"
"app" => myapp
"key1" => "val.1"
"key2" => "val/2"
"level" => "info"
"message" => "my message blabla"
}
注意:我的key=val
事先未知,我想动态解析它们
这是我的配置
input { stdin { } }
filter {
}
output { stdout { codec => rubydebug }}
我的过滤器应该是什么?