码迷,mamicode.com
首页 > 其他好文 > 详细

logstash解析系统的messages日志

时间:2018-07-27 16:58:20      阅读:583      评论:0      收藏:0      [点我收藏+]

标签:hosts   spec   search   sea   移除   ast   line   remove   codec   

logstash解析系统日志的写法,output中的stdout为调试,生产可以移除

input {
    redis {
        host => "192.168.1.181"
        port => 6379
        db => "0"
        data_type => "list"
        key => "815"
    }
}
filter {
    grok {
        match  => {
                "message" => "%{SYSLOGLINE}"
        }
    }
    mutate {
        remove_field => ["prospector","logsource","beat","[message][0]","offset","@version","input"]
    }
    date {
        match => ["timestamp","MMM dd HH:mm:ss"]
    }
    mutate {
        remove_field => ["timestamp"]
    }
}
output {
    elasticsearch {
        hosts  => ["10.78.1.184:9200","10.78.1.185:9200","10.78.1.188:9200"]
        index  => "message-%{+YYYY.MM.dd}"
    }
    stdout { codec => rubydebug }
}

logstash解析系统的messages日志

标签:hosts   spec   search   sea   移除   ast   line   remove   codec   

原文地址:http://blog.51cto.com/liuzhengwei521/2151159

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!