logstash.conf 根据不同地址创建索引

input {
http {
host => "0.0.0.0"
port => 9700
type => "from_ys"
}
}
input {
http {
host => "0.0.0.0"
port => 9600
type => "from_sc"
}
}

output{
if [type] == "from_ys"{
elasticsearch {
hosts => ["192.168.123.1:9200"]
index => "logstash-test-%{+YYYY.MM.dd}"
flush_size => 100
}
}

if [type] == "from_sc"{
elasticsearch {
hosts => ["192.168.122.1:9200"]
index => "logstash-test-pro-%{+YYYY.MM.dd}"
flush_size => 100
}
}
}

 

你可能感兴趣的:(logstash.conf 根据不同地址创建索引)