tAddLocationFromIP
Replaces IP addresses with geographical locations.
tAddLocationFromIP geolocates visitors through their IP addresses:
this component identifies visitors’ geographical locations (country, region, city,
latitude, longitude, ZIP code, etc.) using an IP address lookup database file.
tAddLocationFromIP Standard properties
These properties are used to configure tAddLocationFromIP running in the Standard Job framework.
The Standard
tAddLocationFromIP component belongs to the Misc family.
The component in this framework is generally available.
Basic settings
Schema and Edit |
A schema is a row description, it defines the fields to be processed and passed on to |
|
Built-in: You create and store |
|
Repository: Select the Repository |
Database Filepath |
The path to the IP address lookup database file. |
Input parameters |
Input column: Select the input |
|
input value is a hostname: Check |
|
input value is an IP address: |
Location type |
Country code: Check to replace IP |
|
Country name: Check to replace IP |
Advanced settings
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
Global Variables |
NB_LINE: the number of rows processed. This is an After
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component is an intermediary step in the data flow allowing |
Limitation |
Due to license incompatibility, one or more JARs required to use this component are not
|
Scenario: Identifying a real-world geographic location of an IP
The following scenario creates a three-component Job that associates an IP with a
geographical location. It obtains a site visitor’s geographical location based on its
IP.
Dropping and linking components
- Drop the following components from the Palette onto the design workspace: tFixedFlowInput, tAddLocationFromIP, and tLogRow.
-
Connect the three components using Row
Main links.
Configuring the components
- In the design workspace, select tFixedFlowInput, and click the Component tab to define the basic settings for tFixedFlowInput.
-
Click the […] button next to Edit Schema to define the structure of the data
you want to use as input. In this scenario, the schema is made of one column
that holds an IP address. -
Click OK to close the dialog box, and
accept propagating the changes when prompted by the system. The defined
column is displayed in the Values panel of
the Basic settings view. -
In the Number of rows field, enter the
number of rows to be generated, and click in the Value cell and set the value for the IP address. -
In the design workspace, select tAddLocationFromIP and click the Component tab to define the basic settings for tAddLocationFromIP.
-
Click the Sync columns button to
synchronize the schema with the input schema set with tFixedFlowInput. -
Browse to the GeoIP.dat file to set its
path in the Database filepath field.Note:Ensure to download the latest version of the IP address lookup
database file from the relevant site as indicated in the Basic settings view of tAddLocationFromIp. -
In the Input parameters panel, set your
input parameters as needed. In this scenario, the input column is the
ip column defined earlier that holds an IP
address. -
In the Location type panel, set location
type as needed. In this scenario, we want to display the country
name. -
In the design workspace, select tLogRow
and click the Component tab and define the
basic settings for tLogRow as needed. In
this scenario, we want to display values in cells of a table.
Saving and executing the Job
- Press Ctrl+S to save your Job.
-
Press F6 or click Run in the Run tab to
execute the Job.
One row is generated to display the country name that is associated with the set
IP address.