This plugin, named 'GeoIp service', is designed to convert an IP address into detailed location information. It leverages MaxMind's GeoLite2 services to identify the geographical location associated with a given IP address.
When the GeoIp service plugin receives an IP address, it communicates with the MaxMind GeoLite2 server to fetch location data corresponding to that IP. This data includes city, country (with name and ISO code), county, postal code, and geographic coordinates (latitude and longitude). If configured, the plugin can also add the fetched location details to the user's profile, updating the last known location of the device. The plugin outputs the location data, and in case of any errors during the process, it provides an error output with details.
Inputs and Outputs
- Inputs: The plugin takes a payload object, which should contain the IP address.
- Outputs: There are two output ports:
- location: Outputs location details in a structured format.
- error: Triggered if there is an error during execution, providing details of the payload and error.
- Source: Select the Maxmind Geolite2 server resource for connecting to the service.
- IP Path: Specify the path to the IP data or directly input the IP address.
- Add to Profile: Choose whether to add the discovered location to the profile's last device location.
This plugin requires the configuration of an external resource: a Maxmind Geolite2 server. The resource should include credentials such as the host, license key, and account ID.
- "An error occurred during location fetching": This message indicates a failure in retrieving location information from the GeoLite2 server. It may occur due to network issues, incorrect resource configuration, or invalid IP address input.
- "Failed to update the profile with location data": This error occurs if there is an issue in adding the fetched location to the user's profile, possibly due to profile access or update rights.