Hi team,
I am trying to send output to two different index by taking two different inputs in tcp and beats. I am able to send logs to elasticsearch which are coming from filebeat but I am not able to send the logs to logstash index which are coming from a different source in form of tcp. Below is the configuration for the same. Am I doing something wrong?
input {
tcp {
port => 9600
tags => ["tcp"]
type => "tcp"
}
beats {
port => 5044
tags => ["beats"]
type => "beats"
}
}
filter {}
output {
if "beats" in [tags] {
elasticsearch {
hosts => ["localhost:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
}
if "tcp" in [tags] {
stdout {
codec => json
}
elasticsearch {
hosts => ["localhost:9200"]
index => "logstash-%{+YYYY.MM.dd}"
}
}
}
Do you have data coming in through TCP? Do you get output to stdout? Are there any filters that could be causing problems?
Document types are being deprecated in Elasticsearch so I would recommend not setting the type in the inputs as this could cause problems, at least down the line.
No data is coming in through TCP. So, no output to stdout. I am confused why it's not coming. Sending you the part of the configuration file from where I am sending the logs to logstash:
If no data is coming in on TCP I assume you need to check the systems sending that data and check progress step by step. I am not sure how much we can help with that.
Check the Logstash logs at startup to see if there is any issue with the use of port 9600. It might also be worth changing it to something else and see if that helps as well.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.