As suggested by @magnusbaeck I create a new topic about customized index name with multiple inputs.
Case :
I have 2 Apache logs from 2 projects which are stored separately in the directories /tmp/toto/first
and /tmp/toto/second.
Now, I want to have different index names distinguished by the project name (first and second). In Apache logs, there's no information about where it is stored (path information). I use Filebeat + LogStash + ES + Kibana with the latest version 5.2.1
What I do :
My configuration is as below
Filebeat :
...
paths:
- /tmp/toto/*/*.log
...
LogStash :
input {
beats {
port => "5043"
}
}
filter {
grok {
match => { "paths" => "/tmp/toto/(?<project>[^/]+)/" }
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
}
output {
elasticsearch {
hosts => [ "127.0.0.1:9200" ]
index => [ "log-%{project}-%{+YYYY.MM.dd}" ]
}
}
My question :
My index name is shown as log-%{project}-2017.02.22
. My question is in my case, is it possible to have customized index ? Could grok unterstand the path information by key value paths
in Filebeat ? How does Filebeat transfer log information to message
to let gork understand ? Is there a list of elements like message
in grok to match ?
Thanks in advance.