Logstash系列:conf配置文件Demo

 

2+1

pipeline有两个必选元素:input and output,一个可选:Filter:

Logstash系列:conf配置文件Demo

 

conf

Logstash系列:conf配置文件Demo

 

input {
    kafka {
        bootstrap_servers => "192.168.40.148:9092"
        group_id => "logstash-es"
        topics => ["es"]
        decorate_events => false
        codec => json
        client_id => "node-es"
    }

}

filter { 
    mutate{
        id => "es_add_pipeline"
        add_field => {
            "pipeline" => "es"
        }
    }
}

output { 
        elasticsearch {
            action => "index"
            hosts => ["192.168.40.148:9200"]
            index  => "topic-%{pipeline}-%{+YYYY.MM.dd}"
        }
}

 

Logstash系列:conf配置文件Demo