Expressions

Both the conditions and the actions defined in a rule allow the use of expressions. For example, the comparison part of a rule allows the comparison of an event attribute with an expression.

Probably the simplest expression is a string constant. String constants are specified as a set of characters. For example, Hello World! is an example of a string constant.

A few things to remember about string special characters within a string constant:

  • Leading and trailing spaces are removed. You can avoid this by using double quotes:
  • " This has a leading space and a trailing space "
  • The only non-printing character allowed within a string is the space. For other non-printing characters, use a backslash escape to represent the character. For example:
  • \tThis string starts with a tab character

The following table lists the backslash ( \) escape strings you can use to represent any character.

Usage Meaning
\f An ASCII form feed character
\n An ASCII newline character
\r An ASCII return character
\t An ASCII tab character
\\ An ASCII single backslash ( \) character
\' An ASCII apostrophe or single quote ( ') character
\" An ASCII quote ( ") character
\$ An ASCII dollar ( $) character
\u hhhh The 16-bit character represented by the four hexadecimal digits (Unicode)
\x hh The 8-bit character represented by the two hexadecimal digits

Aside from strings, expressions can also contain the values of event attributes represented by $ atttributeName or $( attributeName) . For example:

The current user is $(DXAGENT_USERNAME)

Variables are expanded within double quotes:

"The current user is $DXAGENT_USERNAME"

Variables are not expanded within single quotes:

'This will not get expanded $DXAGENT_USERNAME'

The following topic lists name value pairs:

Related Links