Back to Custom Threat Models

Operator Reference

Complete reference for all condition operators: equals, contains, not_in, regex, exists, and numeric comparisons.

Last updated: 2026-03-11

Operator Reference

Every filter inside a condition has three properties: field, operator, and value. This page documents every supported operator.

Full Operator Table

OperatorAliasesValue TypeDescription
equalseqstring / numberExact match (loose string coercion: "200" matches 200)
not_equalsneq, nestring / numberNot equal
containsstringCase-insensitive substring match. Ideal for metadata.raw_log searches
not_containsstringField does not contain the substring
starts_withstringCase-insensitive prefix match
ends_withstringCase-insensitive suffix match
gtgreater_thannumberNumeric greater-than
ltless_thannumberNumeric less-than
gtegreater_than_or_equalnumberNumeric ≥
lteless_than_or_equalnumberNumeric ≤
inarrayactualValue is one of the array items (string coercion)
not_inarrayactualValue is not in the array
existsField is non-null and non-undefined. No value required
not_existsField is null or undefined
regexstringCase-insensitive regular expression match against the field value

Operator Examples

equals

Match events where the service is exactly "ssh":

{ "field": "metadata.service", "operator": "equals", "value": "ssh" }

contains

Find raw log lines that mention invalid SSH users:

{ "field": "metadata.raw_log", "operator": "contains", "value": "invalid user" }

not_in

Flag data exports to any country not on your approved list:

{
  "field": "metadata.destination_country",
  "operator": "not_in",
  "value": ["US", "GB", "DE", "CA", "AU"]
}

gt (greater than)

Alert when a single export exceeds 10,000 records:

{ "field": "metadata.record_count", "operator": "gt", "value": 10000 }

exists

Only match events where a VPN field has been populated:

{ "field": "metadata.network_intelligence.is_vpn", "operator": "exists" }

regex

Match user-agents that look like bots or scanners:

{
  "field": "metadata.user_agent",
  "operator": "regex",
  "value": "(sqlmap|nikto|masscan|zgrab|nuclei|nmap)"
}

in

Fire only for high-risk country logins:

{
  "field": "metadata.country_code",
  "operator": "in",
  "value": ["KP", "IR", "SY", "CU"]
}

Combining Operators with AND / OR

AND — all conditions must be true

{
  "logical_operator": "AND",
  "filters": [
    { "field": "metadata.network_intelligence.is_datacenter", "operator": "equals", "value": "true" },
    { "field": "metadata.service", "operator": "equals", "value": "ssh" }
  ]
}

OR — at least one condition must be true

{
  "logical_operator": "OR",
  "filters": [
    { "field": "metadata.network_intelligence.is_vpn",  "operator": "equals", "value": "true" },
    { "field": "metadata.network_intelligence.is_tor",  "operator": "equals", "value": "true" },
    { "field": "metadata.network_intelligence.is_proxy","operator": "equals", "value": "true" }
  ]
}

NOT — negates the first filter

{
  "logical_operator": "NOT",
  "filters": [
    { "field": "metadata.method", "operator": "equals", "value": "saml_sso" }
  ]
}

This matches any event where the auth method is not SAML SSO.

Common Pitfalls

MistakeFix
Boolean values as booleans: "value": trueUse string coercion: "value": "true" — the engine compares via String(actual)
Using regex operator with catastrophic backtracking patternsTest your regex externally first; invalid patterns are silently skipped
Filtering on enriched fields (is_datacenter) before enrichment runsThese fields are set by LiteSOC during ingestion — always available by the time rules run
not_in with an empty arrayAlways matches (nothing is in []). Add a guard or use exists

Next: Example Rule Library →

Related Articles

Was this article helpful? Need more assistance?