美文网首页
Logsash RabbitMQ

Logsash RabbitMQ

作者: tingshuo123 | 来源:发表于2018-11-21 14:29 被阅读6次
    input{
            rabbitmq {
                    host => "192.168.1.200"
                    #连接本地的rabbitmq可以不用设置user和password 默认guest 远程则需要另外创建一个用户
                    user => "admin"              
                    password => "admin" 
                    ######################    
                    queue => "topic_log_error"
                    durable => true
                    codec => "plain"
                    type => "error"
            }
            rabbitmq {
                    host => "192.168.1.200"
                    #与上同
                    user => "admin"
                    password => "admin"
                    queue => "topic_log_info"
                    codec => "plain"
                    durable => true
                    type => "info"
            }
    
    }
    filter {
            if ([message]== "")
            {
                drop {}
            }
    }
    
    output {
            if [type] == "error" {
                    elasticsearch {
                            hosts => [ "192.168.1.200:9200"]
                            index => "logstash-error"
                    }
            }
            if [type] == "info" {
                    elasticsearch {
                            hosts => [ "192.168.1.200:9200"]
                            index => "logstash-info"
                    }
            }
            stdout{
                    codec => rubydebug
             }
    }
    

    相关文章

      网友评论

          本文标题:Logsash RabbitMQ

          本文链接:https://www.haomeiwen.com/subject/hqhcqqtx.html