Hello All ,
I want to re-use the config lines in output logstash as shown below. I am using if condition but is throwing some error. Please help me out.
output {
elasticsearch
{
hosts => ["https://XXXXXnet:8200"]
user => "${es_usr}"
password => "${es_pwd}"
if "RequestRouter" in [source] and "VAGAPIEMEA" in [InterfaceName]
{
index => "prodsrvrlog-reqrouter-vagapi-%{log_day}"
}
else if "RequestRouter" in [source]
{
index => "prodsrvrlog-reqrouter-%{log_day}"
}
else if "FleetboardListener" in [source]
{
index => "api_fleet_list-%{log_day}"
}
else if "SComm" in [source]
{
index => "scomm-%{log_day}"
}
else if "metric" in [fields][type]
{
index => "metricbeat-%{+YYYY.MM.dd}"
}
else if "PROD" in [fields][env]
{
index => "prodsrvrlog-%{log_day}"
}
else
{
index => "otherdata-%{+YYYY.MM.dd}"
}
ssl => true
ssl_certificate_verification => false
cacert => "E:\ELK\ODForESearch\config\chain.pem"
ilm_enabled => false
document_id => "%{[fingerprint]}"
}