Hi,
I am using filebeat->logstash->elastic->kibana
I am unable to create multiple index in elastic . Please advise. One index is getting created but not both.
Filebeat.yml is below
filebeat.prospectors:
- type: log
paths:- /var/lib/mesos/slave/slaves//frameworks//executors//runs/latest/stdout
- /var/lib/mesos/slave/slaves//frameworks//executors//runs/latest/stderr
- /var/log/mesos/*.log
fields:
log_type: docker-logs
- type: log
paths:- /nfs/nfsbackup/dcos-stage2/bhw-nginx/logs/access*
- /nfs/nfsbackup/dcos-stage2/bhw-nginx/logs/error*
fields:
log_type: nginx-logs
fields_under_root: true
exclude_files: ["stdout.logrotate.state", "stdout.logrotate.conf", "stderr.logrotate.state", "stderr.logrotate.conf"]
tail_files: true
output.logstash:
hosts: - "192.168.2.136:5044"
password: changeme
username: logstash_system
logstash.conf file under pipeline is below -
input {
beats {
port => "5044"
}
}
filter {
if [log_type] == "nginx-logs" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}"}
}
}
else if [log_type] == "docker-logs" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}"}
}
}
}
output {
if [log_type] == "nginx-logs" {
elasticsearch {
hosts => ["192.168.2.191:9201","192.168.2.138:9201","192.168.2.195:9201"]
user => "elastic"
password => "changeme"
index => "web-%{+YYYY.MM.dd}"
}
}
else if [log_type] == "docker-logs" {
elasticsearch {
hosts => ["192.168.2.191:9201","192.168.2.138:9201","192.168.2.195:9201"]
user => "elastic"
password => "changeme"
index => "app-%{+YYYY.MM.dd}"
}
}
}
I can only see web index got created but not the app index. I tried all the ways but no gain.


