update logstash

main
ycz008 2023-09-27 14:45:17 +08:00
parent fd98ccac2b
commit 4daec55d61
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@ data:
filebeat.inputs: filebeat.inputs:
- type: log - type: log
paths: paths:
- /data/app_logs/*/logstash/*.log - /data/app_logs/*/*/logstash/*.log
json.keys_under_root: true json.keys_under_root: true
tags: ['json'] tags: ['json']

View File

@ -16,13 +16,17 @@ data:
source => "message" source => "message"
} }
} }
mutate {
split => { "log.file.path" => "/" }
add_field => { "env" => "%{[hostlog.file.path][2]}" }
}
} }
output { output {
stdout { codec => rubydebug } stdout { codec => rubydebug }
elasticsearch { elasticsearch {
hosts => ["http://elastic:9200"] hosts => ["http://elastic:9200"]
index => "dev-logback-beaconfire-%{+YYYY.MM.dd}" index => "%{[env]}-logback-beaconfire-%{+YYYY.MM.dd}"
} }
} }
logstash.yml: |- logstash.yml: |-