Hi,
how to use loops for output in logstash.
output {
if [my_index] == "order"{
elasticsearch {
hosts => [ "172.160.0.234" ]
index => "order-%{+YYYY.MM.dd}"
}
}
if [my_index] == "merchant"{
elasticsearch {
hosts => [ "172.160.0.234}" ]
index => "merchant-%{+YYYY.MM.dd}"
}
}
if [my_index] == "service"{
elasticsearch {
hosts => [ "172.160.0.234" ]
index => "service-%{+YYYY.MM.dd}"
}
}
if [my_index] == "reorder"{
elasticsearch {
hosts => [ "172.160.0.234}" ]
index => "reorder-%{+YYYY.MM.dd}"
}
}
else {
elasticsearch {
hosts => [ "172.160.0.234}" ]
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
}
}
stdout { codec => rubydebug }
}