Skip to content

Commit

Permalink
fix renaming some json fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Mar 4, 2024
1 parent 23eff16 commit 8bd8e44
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions logstash/pipelines/zeek/11_zeek_parse.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5815,7 +5815,17 @@ filter {
# broker.log
# https://docs.zeek.org/en/master/scripts/base/frameworks/broker/log.zeek.html

if ("_jsonparsesuccess" not in [tags]) {
if ("_jsonparsesuccess" in [tags]) {
mutate {
id => "mutate_rename_zeek_json_broker_fields"
rename => { "[zeek_cols][ty]" => "[zeek_cols][event_type]" }
rename => { "[zeek_cols][ev]" => "[zeek_cols][event_action]" }
rename => { "[zeek_cols][peer.address]" => "[zeek_cols][peer_ip]" }
rename => { "[zeek_cols][peer.bound_port]" => "[zeek_cols][peer_port]" }
rename => { "[zeek_cols][message]" => "[zeek_cols][peer_message]" }
}

} else {
dissect {
id => "dissect_zeek_diagnostic_broker"
# zeek's default delimiter is a literal tab, MAKE SURE YOUR EDITOR DOESN'T SCREW IT UP
Expand Down Expand Up @@ -5877,7 +5887,13 @@ filter {
# Logging for establishing and controlling a cluster of Zeek instances
# https://docs.zeek.org/en/master/scripts/base/frameworks/cluster/main.zeek.html#type-Cluster::Info

if ("_jsonparsesuccess" not in [tags]) {
if ("_jsonparsesuccess" in [tags]) {
mutate {
id => "mutate_rename_zeek_json_cluster_fields"
rename => { "[zeek_cols][message]" => "[zeek_cols][node_message]" }
}

} else {
dissect {
id => "dissect_zeek_diagnostic_cluster"
# zeek's default delimiter is a literal tab, MAKE SURE YOUR EDITOR DOESN'T SCREW IT UP
Expand Down

0 comments on commit 8bd8e44

Please sign in to comment.