Document toolboxDocument toolbox

To Set (set)

Description

This operation converts a given array into a set.

How does it work in the search window?

Select Create field in the search window toolbar, then select the To set operation. 

You need to specify at least one argument, and you can add as many value arguments as needed:

Argument

Data type

Argument

Data type

Array mandatory

Array

Use the Make Array (mkarray) operation to convert a field to array data type.

Automatic conversion

Fields of a different data type will be automatically converted to the target data type for the operation, if possible. When not possible, you must first convert the field to the expected data type.

The data type of the values in the new field is set.

Example

In the siem.logtrust.web.activity table, we want to transform the integer values in the SrcPort and Server port fields into arrays. Then, we want to use the array to create a set.

First we will create a new field using the Make array operation. Let's call the new field Array.

The arguments needed to create the new field are:

  • value - SrcPort

  • value - Server port

Click Create field and you will see the following result:

Now, we will use this Array to make a Set using the To Set (set) operation:

You will see the following result:

How does it work in LINQ?

Use the operator select... as...  and add the operation syntax to create the new field.

This is the syntax for the To set operation.

Use:

set :: [.a] -> {.a}

Example

from siem.logtrust.web.activity select [serverPort, srcPort] as array, set(array) as Set