消息: key1 = val1,key2 = val2,key3 = val3
以下是我的logstash过滤器:
filter {
grok {
"match" => { "message" => "%{SYSLOGTIMESTAMP:msg_timestamp} %{GREEDYDATA:kvFields}"
}
}
kv {
source => "kvFields"
field_split => ","
trim_key => " "
trim_value => " "
}
}
Logstash输出:
{
"key1" => "val1",
" key2" => "val2",
" key3" => "val3"
}
这里我要删除所有字段中的空格。我尝试使用trim_key => " \ S"在kv过滤器中。仍然没有运气。
如果有任何其他方法,请帮助删除所有logstash字段中的空格。