Operator IPASNEnricher

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streamsx.network/op$com.ibm.streamsx.network.enrichment$IPASNEnricher.svg

This operator enriches IPv4 and IPv6 addresses with ASN data. Only the MaxMind© GeoLite ASN database is supported.

In order to use this operator, you must download the MaxMind© GeoLite ASN database files in CSV format from the MaxMind© website. These files can then be loaded directly into the operator using the asnIPv4File and asnIPv6File parameters. To dynamically update the operator whenever a new version of the database is downloaded, a DirectoryScan operator can be connected to the control input port (input port 1) of this operator. Whenever a new version of the database files are downloaded into the directory being scanned, the DirectoryScan operator will submit the file paths to the IPASNEnricher operator. The operator will parse the database files and update it's internal tables.

Summary

Ports
This operator has 2 input ports and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 3 parameters.

Optional: asnIPv4File, asnIPv6File, inputIPAttr

Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Never - Operator never provides a single threaded execution context.

Input Ports

Ports (0)

Ingests tuples containing IP addresses. The inputIPAttr parameter specifies the attribute containing the IP addresses.

Properties

Ports (1)

Control port that ingests a file path pointing to a MaxMind ASN database CSV file. The operator determines whether the database contains IPv4 or IPv6 information based on the name of the file. The expected file names are:

  • For IPv4: "GeoIPASNum2.csv"
  • For IPv6: "GeoIPASNum2v6.csv"

This control port can be used to dynamically update the operator's internal ASN database. Each time a tuple is received containing a path to one of the files listed above, the operator will update it's internal table with the data in the file.

This input port expected a tuple containing a single attribute of type rstring.

Properties

Output Ports

Assignments
This operator allows any SPL expression of the correct type to be assigned to output attributes.
Output Functions
EnrichFunctions
<any T> T AsIs()

The default function for output attributes. By default, this function assigns the output attribute to the value of the input attribute with the same name.

<any T> T getASNInfo()

Returns the ASN record associated with the input IP address(es).

The return type of this function depends on the type of input attribute specified by the inputIPAttr parameter.

  • If the input attribute has type rstring, then the return type of this function is rstring.
  • If the input attribute has type list<rstring>, then the return type of this function is list<rstring>.

<any T> T getASNumber()
Returns the 32-bit ASN number associated with the input IP address(es). For example, if the ASN record associated with the input IP is "AS26062 IBM",

        then the function will return "26062".

The return type of this function depends on the type of input attribute specified by the inputIPAttr parameter.

  • If the input attribute has type rstring, then the return type of this function is uint32.
  • If the input attribute has type list<rstring>, then the return type of this function is list<uint32>.

Ports (0)

Submits a tuple for each input tuple received on input port 0. Custom output functions are used to specify which attribute should contain the enrichment data. The output tuple attributes whose assignments are not specified are assigned from input attributes.

Properties

Parameters

Optional: asnIPv4File, asnIPv6File, inputIPAttr

asnIPv4File

Specifies the file path of the MaxMind IPv4 ASN database file. Only the CSV-version of the database is supported. This parameter should not be used if input port 1 is defined.

Properties

asnIPv6File

Specifies the file path of the MaxMind IPv6 ASN database file. Only the CSV-version of the database is supported. This parameter should not be used if input port 1 is defined.

Properties

inputIPAttr

Specifies the input attribute containing the IP address (or IP addresses). The attribute can contain either IPv4 or IPv6 addresses. The supported data types for this attribute are rstring and list<rstring>. In the case where the input attributes refers to a type of list<rstring>, the list can contain a mixture of both IPv4 and IPv6 addresses.

Properties