The search command evaluates OR clauses before AND clauses. This evaluation order is different than the order used with the search command. The order in which Boolean expressions are evaluated with the where command is: This search looks for events where the value in the field host is the string value www2. This search looks for events where the field host contains the string value www2. This search looks for events where the field ipaddress is equal to the field clientip. Because of this, you can use the where command to compare two different fields, which you cannot use the search command to do. If the string is not quoted, it is treated as a field name. Also, both commands interpret quoted strings as literals. The where command uses the same expression syntax as the eval command. The where command is a distributable streaming command. To ensure that server- is interpreted as a literal string, enclose the string in double quotation marks. First, server- could be interpreted as a field name or as part of a mathematical equation, that uses a minus sign and a plus sign. If the expression references a literal string, the literal string must be surrounded by double quotation marks. To avoid this, you must enclose the field name server-1 in single quotation marks. This expression could be interpreted as a mathematical equation, where the dash is interpreted as a minus sign. If the expression references a field name that contains non-alphanumeric characters, the field name must be surrounded by single quotation marks. Because the value is a string, it must be enclosed in double quotations.įield names with non-alphanumeric characters Because the field starts with a numeric it must be enclosed in single quotations. This expression is a field name equal to a string value. If the expression references a field name that starts with a numeric character, the field name must be surrounded by single quotation marks. Expression characteristicsįield names starting with numeric characters The following table describes characteristics of eval expressions that require special handling. The syntax of the eval expression is checked before running the search, and an exception is thrown for an invalid expression. Required arguments eval-expression Syntax: | | | | Description: A combination of values, variables, operators, and functions that represent the value of your destination field. The where command returns only the results for which the eval expression returns true. These eval-expressions must be Boolean expressions, where the expression returns either true or false. The where command uses eval-expressions to filter search results.
0 Comments
Leave a Reply. |