logstash 匹配日志格式

 

2017-05-15 12:06:17 INFO  me.cinyi.imapp.push.commons.iospush  - 用户ID[1000]-标识[11500], admin推送通知成功, messages:[6921]ms

 

 

input {
        stdin{}
}

filter {
    grok{
       #match => {"message" => "%{WORD:method}"}
       #match => {"message" => "(?:%{SYSLOGTIMESTAMP:syslog_timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) %{WORD:method} %{GREEDYDATA:pushios} %{NUMBER:costs} \[${WORD:ms}"}
       match => {"message" => "(?:%{SYSLOGTIMESTAMP:syslog_timestamp}|%{TIMESTAMP_ISO8601:timestamp8601}) %{WORD:method} %{GREEDYDATA:pushios} %{WORD:method}\:\[%{NUMBER:costes}\]%{WORD:sencode}"}
       }
}

output {
        stdout{
                codec   =>      rubydebug
        }
}

 

posted @ 2017-05-18 17:13  fengjian1585  阅读(1049)  评论(0编辑  收藏  举报