Skip to content

Can't add_field %{host} for udp #19

@slatemine

Description

@slatemine

bug / inconsistency: For the config below:

  • TCP adds a field with the IP address, eg { ... "logHost" => "127.0.0.1" }
  • UDP adds the literal "%{host}", eg { ... "logHost" -> "%{host}" }
input {
  tcp {
    port => "514"
    add_field => { 
        "logHost" => "%{host}"
    }
  }
  udp {
    port => "514"
    add_field => { 
        "logHost" => "%{host}"
    }
  }
}

I add this field to make auditing / monitoring logging coverage easier.

The fix is simple, decorate is being called before event["host"] is being set.
patch.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions