update prod filebeat

main
ycz008 2024-01-17 16:50:27 +08:00
parent 0fb789fba1
commit c01d71beaf
2 changed files with 7 additions and 3 deletions

View File

@ -29,13 +29,13 @@ 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']
#All data to indexed to Elasticsearch #All data to indexed to Elasticsearch
output.logstash: output.logstash:
hosts: ["logstash.base.svc:5044"] hosts: ["log-app.beaconfireinc.com:30012"]
--- ---
apiVersion: apps/v1 apiVersion: apps/v1

View File

@ -18,12 +18,16 @@ data:
source => "message" source => "message"
} }
} }
mutate {
split => { "[log][file][path]" => "/" }
add_field => { "env" => "%{[log][file][path][3]}" }
}
} }
output { output {
elasticsearch { elasticsearch {
hosts => ["http://10.2.0.12:30019"] hosts => ["http://10.2.0.12:30019"]
index => "prod-logback-beaconfire-%{+YYYY.MM.dd}" index => "%{[env]}-logback-beaconfire-%{+YYYY.MM.dd}"
} }
} }
logstash.yml: |- logstash.yml: |-