DNS Filter
This filter will resolve any IP addresses from a field of your choosing.
The DNS filter performs a lookup (either an A record/CNAME record lookup or a reverse lookup at the PTR record) on records specified under the "reverse" and "resolve" arrays.
The config should look like this:
filter {
dns {
type => 'type'
reverse => [ "@source_host", "field_with_address" ]
resolve => [ "field_with_fqdn" ]
action => "replace"
}
}
Caveats: at the moment, there's no way to tune the timeout with the 'resolv' core library. It does seem to be fixed in here:
http://redmine.ruby-lang.org/issues/5100
but isn't currently in JRuby.
filter {
dns {
action => ... # ["append", "replace"] (optional)
add_field => ... # hash (optional), default: {}
add_tag => ... # array (optional), default: []
resolve => ... # array (optional)
reverse => ... # array (optional)
tags => ... # array (optional), default: []
type => ... # string (optional), default: ""
}
}
Determine what action to do: append or replace the values in the fields specified under "reverse" and "resolve."
If this filter is successful, add any arbitrary fields to this event. Example:
filter {
myfilter {
add_field => [ "sample", "Hello world, from %{@source}" ]
}
}
On success, myfilter will then add field 'sample' with the value above and the %{@source} piece replaced with that value from the event.
If this filter is successful, add arbitrary tags to the event. Tags can be dynamic and include parts of the event using the %{field} syntax. Example:
filter {
myfilter {
add_tag => [ "foo_%{somefield}" ]
}
}
If the event has field "somefield" == "hello" this filter, on success, would add a tag "foo_hello"
Forward resolve one or more fields.
Reverse resolve one or more fields.
Only handle events with all of these tags. Note that if you specify a type, the event must also match that type. Optional.
The type to act on. If a type is given, then this filter will only act on messages with the same type. See any input plugin's "type" attribute for more. Optional.