Filter Syntax Reference

   

This topic describes the syntax to use when constructing filters using the filter text editor. You access the filter text editor by clicking Edit Text on the Filter Editor dialog box.

When you click Edit Text, you will see a message warning you that some of the filters you can create using the filter text editor cannot be represented in the graphical filter editor. You can click Yes to confirm you want to use the filter text editor, or No to move back to the graphical filter editor.

The filter text editor is shown in the following illustration.

To use the filter text editor, type your expression in the box and click OK when you are satisfied. When you click OK, Visual Studio Analyzer evaluates your expression and displays a message if there are errors.

Syntax for Visual Studio Analyzer Filters

A valid statement in the filter text editor consists of three parts:

  • Operand

  • Operator

  • Comparison value

For example, the following is a valid statement:

Machine = "MyMachine"

You can combine statements with logical tokens, such as AND and OR, to create expressions. Enclose the entire filter expression in parentheses, and use parentheses inside the expression as needed for grouping. The following table lists valid operands, operators, and logical tokens.

Operands Operators Logical Tokens
Category

Component

Event

Machine

Process

Source

SourceComponent

SourceMachine

SourceProcess

TargetComponent

TargetMachine

TargetProcess

!=

<>

=

==

Contains "string"

DoesNotContain "string"

Equal

IsOneOf ("Value1", "Value2", ... "ValueN" ).
Make sure the final value in the list is followed by a space.

or

IsOneOf ({guid1}, {guid2}, ...{guidN} ).
Make sure the final value in the list is followed by a space.

NotEqual

!(Logical NOT — C/C++ style)

&&(Logical AND — C/C++ style)

((Open parenthesis)

)(Close parenthesis)

,(Comma — only used in value lists for the IsOneOf operator)

||(Logical OR — C/C++ style)

AND

NOT

OR

Note:   You can use the Contains and DoesNotContain operators to match the presence or absence of a certain string from a field. However, because of the way Visual Studio Analyzer optimizes certain fields internally, some fields cannot have these operators applied to them in this release. These fields are the component fields (SourceComponent, TargetComponent, Component) and the events and category fields. Thus, it is not possible to collect all call-type events by specifying Event Contains "Call".

Comparison Values

Comparison values must be enclosed in single or double quotation marks if they are strings. You can use a backslash (\) as an escape character to denote single or double quotation marks that are part of a string. Enclose comparison values that are GUIDs in curly braces ({}).