Hello, I have multiple porspectors on a filebeat.yml configuration file. Each of these prospector has a unique type:
filebeat:
prospectors:
-
paths:
- file*.csv
input_type: log
document_type: type1
-
paths:
- file*.log
input_type: log
document_type: type2
[...]
While the Logstash configuration is like this:
input {
beats {
port => 5044
}
}
filter {
if [type] == "type2" {
grok { [some-grok-configuration-here] }
}
else if [type] == "type1" {
csv { [some-csv-configuration-here] }
output {
if [type] == "type2" {
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "logstash-type2-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}
else if [type] == "type1" {
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "logstash-type1%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}
}
From the Filebeat log I see that all the files are correctly sent with the correct "type" field to Logstash. However, Logstash pipeline is only showing type2 and obviously I can't find type1 on Elasticsearch.
Could you help me figuring out why this is happening?