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 field in the search window toolbar, then select the IP Protocol operation. This operation needs only one argument. You can choose a field 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 field.

The data type of the new field 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 field into protocol names. We will create a new field using the IP Protocol operation to do it.

The arguments needed to create the new field are:

  • Integer to convert - ProtocolCode field

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

How does it work in LINQ?

Use the operator select... as...  to apply the Create field 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