I am trying to tag every log file path in filebeat and in logstash, use that tag to create separate index for each log file. But only one index is being created. Why does document_type not work here?
Here is my filebeat.yml-
filebeat.inputs:
-
paths:
- E:\DemoSetup\DispatcherApp\logs\dispatcher-scheduler.log
input_type: log
document_type: DispatcherApp
-
paths:
- E:\DemoSetup\Incident Agent\Logs\Trace.log
input_type: log
document_type: IncidentAgent
output:
logstash:
hosts: ["localhost:5044"]
And my logstash.conf-
input {
file{
path: E:\DemoSetup\DispatcherApp\logs\dispatcher-scheduler.log
type => "DispatcherApp"
}
file{
path: E:\DemoSetup\Incident Agent\Logs\Trace.log
type => "IncidentAgent"
}
beats {
port => 5044
}
}
filter {
if[type] =="DispatcherApp"{
grok {
match => {"message" => "%{COMBINEDAPACHELOG}"}
}
} else [type] == "IncidentAgent" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
sniffing => true
manage_template => false
index => "%{[@metadata][beat]-%{+YYYY.MM.dd}"
}
}