filebeat.inputs:
- type: log
enabled: true
fields:
type: "info"
paths:
- D:\ideaWorkspace\demo\info\*.log
multiline.pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
multiline.negate: true
multiline.match: after
- type: log
enabled: true
fields:
type: "error"
paths:
- D:\ideaWorkspace\demo\error\*.log
multiline.pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
multiline.negate: true
multiline.match: after
output.elasticsearch:
hosts: ["localhost:9200"]
indices:
- index: "infoindex"
when.equals:
fields.type: "info"
- index: "errorindex"
when.equals:
fields.type: "error"