update logstash input

main
ycz008 2024-02-23 10:56:13 +08:00
parent f5df8aa922
commit 1c30d049be
1 changed files with 8 additions and 4 deletions

View File

@ -5,8 +5,12 @@ metadata:
data: data:
logstash.conf: |- logstash.conf: |-
input { input {
beats { kafka{
port => 5044 bootstrap_servers => "10.2.0.12:30002,10.2.0.12:30003,10.2.0.12:30004"
topics => ["nginx-dev"]
group_id => "logstash-ngx"
auto_offset_reset => "earliest"
codec => json
} }
} }
@ -16,8 +20,8 @@ data:
target => "@timestamp" target => "@timestamp"
} }
mutate { mutate {
add_field => { "env" => "%{[tags][0]}" } add_field => { "env" => "%{[fields][env]}" }
remove_field => [ "tags" ] remove_field => [ "fields" ]
} }
} }