Search Filter Operators
Search filters operate on attributes in order to narrow your search results. Search criteria (predicates) are specified as <attribute> <op> <comparison>, e.g. dns_activity.activity_id = ALLOWED.
| Operator | Description |
|---|---|
= | Field equals <value>. |
== | Like =, but case insensitive. |
!= | Field does not equal <value>. |
!== | Like !=, but case insensitive. |
~, contains | String field contains <value>. |
~~, icontains | Like ~ but case insensitive. |
^=, startswith | String field starts with <value>. |
^==, istartswith | Like ^= but case insensitive. |
$=, endswith | String field ends with <value>. |
$==, iendswith | Like $= but case insensitive. |
in | Enum field is one of <values>, where values is a comma-separated list. The list may optionally be surrounded with parentheses (()). |
iin | Case insensitive in. |
<, >, <=, >= | Numeric field is less than, greater than, less than or equal to, or greater than or equal to <value> |
empty | Field is empty (ex: null or None) |
matches | String field matches a regular expression. See Regular Expressions for the supported syntax. |
imatches | Like matches but case insensitive. |
cidr | IP address field is within a CIDR range. |
not | Negates the following filter (field not contains 'value' or not field contains 'value'). |
Search Filter Operators by Attribute Data Type
| Operator | number | timestamp | string | boolean | enum | hash | IP | JSON | arrays |
|---|---|---|---|---|---|---|---|---|---|
| Equality | |||||||||
=, == | x | x | x | x | x | x | x | ||
!=, !== | x | x | x | x | x | x | x | ||
in, iin | x | x | x | x | x | x | x | ||
| Sorting | |||||||||
< | x | x | x | ||||||
<= | x | x | x | ||||||
>= | x | x | x | ||||||
> | x | x | x | ||||||
| Emptiness | |||||||||
empty | x | x | x | x | x | x | x | x | x |
| Strings | |||||||||
^=, ^== | x | ||||||||
$=,$== | x | ||||||||
~, ~~ | x | ||||||||
| Regex | |||||||||
matches | x | ||||||||
imatches | x | ||||||||
| Network | |||||||||
cidr | x | ||||||||
| Quantifiers | |||||||||
ANY | x | ||||||||
ALL | x |
String Literals
String values may be written with either single quotes ('...') or double quotes ("..."). The two delimiters are equivalent, so name = 'Okta' and name = "Okta" mean the same thing. Use whichever delimiter keeps the value readable.
-
The other quote is a literal. A single-quoted string may contain double quotes, and a double-quoted string may contain single quotes, with no escaping:
WITH file.message = "it's fine" -- value: it's fine WITH file.message = 'say "hello" now' -- value: say "hello" now -
Double the delimiter to include it in a string bounded by that same quote, as in SQL:
WITH file.message = 'it''s fine' -- value: it's fine WITH file.message = "say ""hello"" now" -- value: say "hello" now -
Every other character is itself, including backslash (
\). There are no escape sequences, so Windows paths, registry keys, and regular expressions are written exactly as they appear:WITH file.path = 'C:\Windows\System32\' -- value: C:\Windows\System32\ WITH process_activity.process.cmd_line ~ 'HKLM\Software' -- value: HKLM\Software WITH file.message = 'a\tb' -- value: a\tb (backslash and t, not a tab)
The same rules apply anywhere FSQL accepts a quoted string, including filter values for every operator, FROM display names, quoted attribute captions, and LIKE patterns.
Backslash no longer escapes a quoteEarlier versions of FSQL used a backslash to escape a quote (
'it\'s') and removed backslashes elsewhere, so'C:\\Windows'meantC:\Windows. Now'C:\\Windows'meansC:\\Windows, with two backslashes. A query that still uses\'or\"fails with the error A backslash no longer escapes a quote. To include ' in a string, double it: ''.
Values that are not strings — enum tokens (FAILURE), numbers, connector aliases, UUIDs, and #tags — remain unquoted.
RenderingFSQL is always echoed back using single quotes. A value you type with double quotes is re-rendered with single quotes wherever the query is displayed again (for example in an expanded-query view), with any single quote in the value doubled:
"it's"is shown as'it''s'. The query itself is unchanged.
Regular Expressions
MATCHES and IMATCHES filter a string attribute with a regular expression.
- A pattern can match anywhere in the value.
cmd_line MATCHES 'powershell'is true forC:\Windows\System32\powershell.exe -enc ..., so you don't need a leading or trailing.*. To match the whole value, anchor the pattern with^at the start and\zat the end. IMATCHESignores letter case. It has the same effect as starting the pattern with(?i).
FSQL evaluates regular expressions in linear time: matching time grows with the length of the value, never exponentially with the shape of the pattern. This guarantees that no pattern can stall a search. Some regex features, such as backreferences and lookaround, can't be evaluated in linear time, so FSQL doesn't support them. FSQL checks every pattern before the search starts. If a pattern uses an unsupported feature, the query fails with an error that names the feature, and no data is searched.
Writing Patterns
Because FSQL string literals have no escape sequences, a pattern reaches the regex engine exactly as you write it. Write '\d+' for one or more digits and 'C:\\Windows' for the text C:\Windows, just as you would in any other regex tool. To include the quote character that delimits the pattern, double it, or delimit the pattern with the other quote character:
WITH file.name MATCHES '^it''s' -- pattern: ^it's
WITH file.name MATCHES "^it's" -- pattern: ^it'sSupported Syntax
| Feature | Syntax |
|---|---|
| Literal text, any char | abc, . |
| Alternation | a|b |
| Groups | (...), non-capturing (?:...), named (?P<name>...) |
| Character classes | [abc], [^abc], [a-z], \d, \D, \w, \W, \s, \S |
| Quantifiers | *, +, ?, {n}, {n,}, {n,m} |
| Lazy quantifiers | *?, +?, ??, {n,m}? |
| Anchors | ^, $, \A (start of value), \z (end of value), \b, \B (word boundary) |
| Escaped characters | \., \*, \(, \{, \\, and so on; \xhh for a character by its hex code (\x41) |
| Flags for whole pattern | (?i) ignore case, (?m) multi-line, (?s) . matches newline, (?x) verbose; combine as (?im). Must be at the very start of the pattern. |
| Flags for part of one | (?i:...), (?i-s:...) |
Matching the end of a value
$matches at the end of the value, but also just before a newline at the end of the value. Use\zwhen the value must end exactly there.
Unsupported Syntax
FSQL rejects these features with an "Unsupported regular expression" error.
| Feature | Example | Instead |
|---|---|---|
| Backreference | (a)\1, (?P=name) | No equivalent. |
| Lookahead and lookbehind | (?=...), (?<=...) | Combine several filters with AND. |
| Negative lookahead and lookbehind | (?!...), (?<!...) | Combine filters with AND NOT, e.g. x MATCHES 'a' AND NOT x MATCHES 'ab'. |
| Conditional group | (?(1)yes|no) | No equivalent. |
| Atomic group | (?>...) | No equivalent. |
| Possessive quantifier | a*+, a++, a?+, a{2}+ | Use the ordinary quantifier: a*, a+, a?, a{2}. |
\Z end-of-value anchor | foo\Z | foo\z |
| Repeat with no lower bound | a{,3} | a{0,3} |
| Octal escape | \0, \101 | Hex escape: \x00, \x41. |
| Named Unicode character | \N{BULLET} | Write the character itself. |
| ASCII-only or locale flag | (?a), (?L) | No equivalent. |
| Comment group | (?#...) | Remove the comment, or use # comments under (?x). |
{ that doesn't start a repeat | {}, a{b, {id} | Escape it: \{. |
Space or # inside [...] under (?x) | (?x)[a b], (?x)[#] | Escape it: (?x)[a\ b], (?x)[\#]. |
Outside a character class, \1 through \9 are backreferences, so \101 is reported as a backreference rather than an octal escape.
Some syntax from other regex dialects isn't recognized at all, and FSQL reports it as an "Invalid regular expression". That includes Unicode property classes (\p{L}), turning a flag off for the whole pattern ((?-i)), and setting a flag for the whole pattern anywhere but the start (a(?i)b). Patterns with mismatched parentheses are also invalid.
POSIX character classes such as [[:alpha:]] and [[:digit:]] aren't supported. Use explicit ranges instead, such as [a-zA-Z] or [0-9].
Errors
A rejected pattern produces an error naming the attribute, the unsupported feature, and the pattern. For example, process_activity.process.cmd_line MATCHES '(?=foo)bar' fails with:
Unsupported regular expression for process.cmd_line: lookahead/lookbehind ((?=...), (?<=...)).
Patterns must be evaluated in linear time, without backtracking (no backreferences, lookaround,
conditionals, atomic groups or possessive quantifiers). Pattern: '(?=foo)bar'Updated 14 days ago