I have created an output config for Logstash and attempted to specify which index for a few different feeds to go by using if then else statements in the config file. Reagardless of what I try, Data I do not want in the first filter ends up in that index and the one I specified for it. Data that is supposed to be cause by the first IF statement is nowhere to be found.
I am trying to isolate each data source in its own index without much luck. See the config below:
output
{if [type] == "tomato"
{
elasticsearch
{
hosts => "192.168.1.5:9200"
index => "tomato-%{+YYYY.MM.dd}"
}
}else if "192.168.1.254" in [host]
{
elasticsearch
{
hosts => "192.168.1.5:9200"
index => "pfsense-%{+YYYY.MM.dd}"
}
}else
{
elasticsearch
{
hosts => "192.168.1.5:9200"
index => "logstash-%{+YYYY.MM.dd}"
}
}stdout
{
codec => rubydebug
}}