愚者求师之过,智者从师之长。

logstah修改日志日期格式为毫秒报错 [0] "_rubyexception"

Logstash | 作者 gaven | 发布于2020年08月27日 | 阅读数:1494

filter {
json {
source => "message"
remove_field => ["message"]
remove_field => ["@version"]
remove_field => ["path"]
remove_field => ["@timestamp"]
add_field => { "proCode" => "10" }
}
ruby {
code => "responseReceivedTime = event.get('responseReceivedTime')
localtimeStr = responseReceivedTime.strftime('%s')
event.set(responseReceivedTime, 'localtimeStr')"
}
}
已邀请:

要回复问题请先登录注册