Document toolboxDocument toolbox

Keys (keys)

Description

This operation returns the set of keys of a given map.

How does it work in the search window?

Select Create field in the search window toolbar, then select the Keys operation. You need to specify at one argument:

Argument

Data type

Argument

Data type

map mandatory

Map

Use the Make Map (mkmap) operation to convert a field to map data type.

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

Example

In the siem.logtrust.web.activity table, we want to return the keys of mapped sourcePort and serverPort values.

To do this, we will first use the Make map operation to map the two ports:

You will see the following result:

Now we can get the keys from the map field.

The arguments needed to create the new field are:

  • Map - Map

Click Create field and 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 Keys operation.

Use:

keys({1:null,2:"b",3:"c"}) === {1,2,3} keys({1:null,2:"b",3:"c",null:"d"}) === {1,2,3,null}

Example

You can copy the following LINQ script and try the above example on the siem.logtrust.web.activity table. Keep in mind that you must download and upload the file provided before to your Devo domain.

from siem.logtrust.web.activity select {serverPort: srcPort} as map, keys(map) as keys

 

Â