GeoIP¶
This formatter parses an IP and outputs it’s geo information as metadata fields to the set target.
Parameters¶
GeoIPFile
Defines a GeoIP file to load this setting is mandatory. Files can be found e.g. at http://dev.maxmind.com/geoip/geoip2/geolite2/. By default this parameter is set to “”.
Fields
An array of the fields to extract from the GeoIP. Available fields are: “city”, “country-code”, “country”, “continent-code”, “continent”, “timezone”, “proxy”, “satellite”, “location”, “location-hash” By default this is set to [“city”,”country”,”continent”,”location-hash”].
Prefix
Defines a prefix for each of the keys generated. By default this is set to “”.
Parameters (from core.SimpleFormatter)¶
Source
This value chooses the part of the message the data to be formatted should be read from. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.
Target
This value chooses the part of the message the formatted data should be stored to. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.
ApplyTo
Use this to set Source and Target to the same value. This setting will be ignored if either Source or Target is set to something else but “”. By default this parameter is set to “”.
SkipIfEmpty
When set to true, this formatter will not be applied to data that is empty or - in case of metadata - not existing. By default this parameter is set to false
Examples¶
exampleConsumer:
Type: consumer.Console
Streams: stdin
Modulators:
- format.GeoIP
Source: client-ip