Document toolboxDocument toolbox

IP Protocol (ipprotocol)

Description

Converts an IP protocol name to its protocol code or vice versa. Learn more about IP protocol values here.

How does it work in the search window?

Select Create column in the search window toolbar, then select the IP Protocol operation. This operation needs only one argument. You can choose a column that contains protocol names (string) or protocol codes (integer).

Argument

Data type

Argument

Data type

Integer/String to convert mandatory

integer, string

Be aware that the values used as arguments need to correspond to valid protocol names in case you use an integer or to valid protocol numbers in case you use a string. Otherwise, the operation will return null values in the newly created column.

The data type of the new column is string if the input was integer, or integer if the input was string.


Example


In the my.upload.sample.data table, we want to transform the protocol numbers in the ProtocolCode column into protocol names. We will create a new column using the IP Protocol operation to do it.

The arguments needed to create the new column are:

  • Integer to convert - ProtocolCode column

Click Create column and you'll see the new ProtocolName column containing string values corresponding to the protocol names.

How does it work in LINQ?

Use the operator select... as...  to apply the Create column operation. These are the valid formats of the operation:

  • ipprotocol(integer)

  • ipprotocol(string)

Examples

You can copy the following LINQ script and try the above example on the my.upload.sample.data table. As said above, keep in mind that you must download and upload the file provided before to your Devo domain.

from my.upload.sample.data select split(message, ";", 17) as ProtocolCodeString select int(ProtocolCodeString) as ProtocolCode select ipprotocol(ProtocolCode) as ProtocolName