Document toolboxDocument toolbox

Any name matches (anymatches)

Description

You can apply this operation either as a Filter or Create field operation:

Filter

Filters a field containing sets of names in set(name) format and shows only those values that match one or more of the specified patterns (in namepattern format).

Create field

Creates a new Boolean field that shows true when the values in a set(name) field match one or more of the specified patterns (in namepattern format).

You can find a field containing sets of table names in set(name) format in the all.data table, which contains information about all the tables in your domain. You can also access this table after performing a global search.

About name patterns

Name patterns use asterisks as wildcards to allow you to identify any table whose name matches a pattern. The accepted syntax for glob patterns in Devo include:

  • siem.*.*.* - table names with four levels where the first is siem

  • siem.** - table names with any number of levels where the first is siem

  • **.all.** - table names containing all as a name level at any level in the name

  • **.*ss*.** - table names containing "ss" within a name level at any level in the name

You can see that a single asterisk is a wildcard for part of or a whole level of a table name, while two asterisks represent any number of levels. You must include "." in the name pattern to guide the search. You can transform the strings in a field to name patterns in namepattern data type creating a new field using the Glob pattern on names operation.

How does it work in the search window?

Select Filter / Create field in the search window toolbar, then select the Any name matches operation. You need to specify at least two arguments. You can add as many or matches arguments as required.

Argument

Data type

Argument

Data type

Some name of mandatory

set(name)

matches mandatory

namepattern

or matches

namepattern

If you use the Create field operation, the data type of the values in the new field is boolean (true or false).

When you apply this operation in the search window interface, Devo automatically transforms the values you enter manually in the matches argument into namepattern data type.

If you choose a field in the matches argument, it must be a namepattern data type field. Remember that you can transform the strings in a field to namepatterns creating a new field using the Glob pattern on names operation.

Example

In the all.data table, we want to get only siem tables with four levels in the tables field. We will manually enter the pattern siem.*.*.* to match any table name with siem in its first-level name, and having four levels. To do it, we will apply a Filter using the Any name matches operation.

The arguments needed for the filter are:

  • Some name of - tables field

  • matches - Click the pencil icon and enter siem.*.*.*

Click Filter data and you will see the following result:

If we want to add a field instead, click Create field and follow the same steps. A new Boolean field will be created which shows true when the values in the tables field match the siem.*.*.* format.

How does it work in LINQ?

Use the operator where...  to apply the Filter operation and select... as...  to apply the Create field operation. These are the valid formats of the Any name matches operation:

  • anymatches(setname, nameglob(string))

  • anymatches(setname, namepattern)

When you use this operation in LINQ, you must use the Glob pattern on names operation to transform the field or value entered to namepattern format. To do it, add the nameglob() operator as in the first format example.

Examples

You can copy the following LINQ script and try the above example on the all.data table:

from all.data where anymatches(tables, nameglob("siem.*.*.*"))

And this is the same example using the Create field operation:

from all.data select anymatches(tables, nameglob("siem.*.*.*")) as siem_tables