如何获得logstash中的字段值?

从如低于我输出,如何获得logstash中的字段值?

“消息”=> “< ......。”,
“@version”=> “1”,
“@timestamp”=> “2016-04-29T02:33:34.586Z”,
“时间戳”=> “年04月29 10点30分37秒”,
“syslog_severity_code”=> 5,
“syslog_facility_code”=> 1,
“syslog_facility”=>“用户级别”,
“syslog_severity”=>“通知”

我试图让字段值

filter 

{

mutate {

add_field => {"newfield"=> "timestamp"}

}

,但仍不能获取的时间戳值到新野 它会得到

"newfield" => "newfield", 

是任何人是有同样的问题,或者发现一个办法? 欢迎任何帮助来解决这个问题。

回答:

That`s容易,像这样做:

filter 

{

mutate {

add_field => ["newfield"=> "%{timestamp}"]

}

你可以得到:

"message" => "test it \b\b", 

"@version" => "1",

"@timestamp" => "2016-04-28T09:16:56.934Z",

"host" => "bag",

"timestamp" => "Apr 29 10:30:37",

"new_field" => "Apr 29 10:30:37"

以上是 如何获得logstash中的字段值? 的全部内容, 来源链接: utcz.com/qa/257774.html

回到顶部