Document toolboxDocument toolbox

Make array (mkarray)

Description

 Creates an array from the given value(s).

How does it work in the search window?

Select Create field in the search window toolbar, then select the Make array 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

value mandatory

Any

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 array.

Example

In the siem.logtrust.web.activity table, we want to transform the integer values in the SrcPort and Server port fields into arrays. To do this, 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:

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 Make array operation.

Use:

[1,2,3,4] === mkarray(1,2,3,4) ["a","b","c"] === mkarray("a","b","c") [] === mkarray() ["a",null,"c"] === mkarray("a",null,"c")

Example

You can copy the following LINQ script and try the above example on the my.upload.sample.data table. 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, ";", 16) as posNumbers1 select split(message, ";", 17) as posNumbers2 select int(posNumbers1) as integerValues1 select int(posNumbers2) as integerValues2, [integerValues1, integerValues2] as Array

Â