- input_type: log
paths:
- /opt/tengine/logs/access.log
document_type: nginx-log
json.keys_under_root: true
ignore_older: 24h
- input_type: log
paths:
- /opt/java/logs/java.log
document_type: java-log
json.keys_under_root: true
ignore_older: 24h
output {
if [type] == "nginx-log" {
elasticsearch {
hosts => ["172.18.238.2:9200","172.18.238.3:9200","172.18.238.4:9200"]
index => "%{type}-%{+YYYY.MM.dd}"
}
} else if [type] == "java-log" {
elasticsearch {
hosts => ["172.18.238.2:9200","172.18.238.3:9200","172.18.238.4:9200"]
index => "%{type}-%{+YYYY.MM.dd}"
}
}
}
【踩坑】ELK6.0已取消filebeat配置document_type
原文:http://blog.51cto.com/kexiaoke/2092029