filebeat.prospectors:
- input_type: log
paths:
- /var/log/man/*.log
document_type: "man"
tags: ["man"]
json.keys_under_root: true
json.overwrite_keys: true
- input_type: log
paths:
- /var/log/woman/*.log
document_type: "woman"
tags: ["woman"]
json.keys_under_root: true
json.overwrite_keys: true
processors:
- drop_fields:
fields: ["@timestamp","sort","beat","input_type","offset","source"]
output.elasticsearch:
if "man" in [tags]{
hosts: ["45.106.132.69:9200"]
index: "man-%{[date]}"
template.path: "/usr/template/man.json"
template.name: "man"
template.overwrite: true
}
if "woman" in [tags]{
hosts: ["45.106.132.69:9200"]
index: "woman-%{[date]}"
template.path: "/usr/template/woman.json"
template.name: "woman"
template.overwrite: true
}
2 个回复
rochy - rochy_he
赞同来自:
可以参考上面的案例进行配置
Aruen - 算法工程师
赞同来自: