Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

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

Array 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:

'sort([5,2,3,4,1])              === [1,2,3,4,5]      ',
'sort(["d","a","c","b"])        === ["a","b","c","d"]',
'sort([5,2,3,4,1],       true ) === [1,2,3,4,5]      ',
'sort(["d","a","c","b"], true ) === ["a","b","c","d"]',
'sort([5,2,3,4,1],       false) === [5,4,3,2,1]      ',
'sort(["d","a","c","b"], false) === ["d","c","b","a"]',
'sort([5,2,3,4,1],       null ) === 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

  • No labels