Advanced Search
New / Beta — v3.35
The advanced search syntax replaces the previous simple full-text search. TheRELATED:keyword is the canonical form; the old lowercaserelated:is still accepted for backward compatibility.
The instance list search bar accepts a rich query language. Queries are evaluated against the EAV cache (data_cache table), which stores one indexed row per instance × field. The EAV cache must be up to date for field-level searches to return accurate results — refresh it with cavaliba cache --eav_refresh after bulk data changes.
All filtering is performed in the database engine. Large schemas (tens of thousands of instances) are safe to search.
Quick reference
| Pattern | Meaning |
|---|---|
paris |
full-text: any field value, keyname, or displayname contains “paris” |
city:Paris |
field city contains “Paris” (case insensitive) |
city:Par* |
field city starts with “Par” |
city:*aris |
field city ends with “aris” |
city:*ari* |
field city contains “ari” |
city:"Le Mans" |
field city contains “Le Mans” (space-safe) |
pop:>=500 |
field pop ≥ 500 (numeric) |
pop:>500 |
field pop > 500 |
pop:<=500 |
field pop ≤ 500 |
pop:<800 |
field pop < 800 |
mydate:>="2025-06-01" |
field mydate ≥ “2025-06-01” (lexicographic) |
A AND B |
both A and B must match |
A OR B |
A or B must match |
NOT A |
A must not match |
EXISTS:last_sync |
instance has a last_sync timestamp set (meta field) |
EMPTY:last_sync |
instance has no last_sync timestamp set (meta field) |
NOT EMPTY:last_sync |
instance has a last_sync timestamp set (meta field) |
NOT EXISTS:last_sync |
instance has no last_sync timestamp set (meta field) |
last_sync:>="2026-02-01" |
synced on or after 2026-02-01 (meta field, real date comparison) |
last_sync:2026-02-15 |
synced at any time on 2026-02-15 (meta field) |
is_enabled:True |
enabled instances only (meta field) |
is_enabled:False |
disabled instances only (meta field) |
keyname:par* |
keyname starts with “par” (meta field) |
RELATED:SERVER:srv01 |
instances referencing srv01 in schema SERVER |
Full-text search
A bare word searches case-insensitively across all EAV field values, the instance keyname, and the displayname.
parisMatches any instance where any field contains “paris”, “Paris”, “PARIS”, etc.
nginxFinds servers, apps, services, or any object that mentions “nginx” in any field.
Boolean operators
Use uppercase AND, OR, NOT. Evaluation is left-to-right; no parentheses are supported.
The default connector between consecutive terms (without an explicit operator) is AND.
Paris AND activeInstances containing both “Paris” and “active” somewhere in their fields.
Lyon OR ToulouseInstances containing either “Lyon” or “Toulouse” in any field.
NOT ParisInstances where no field contains “Paris”.
NOT Paris AND activeInstances that do not contain “Paris” but do contain “active”.
Paris OR Lyon OR Toulouse OR BordeauxAny of the four cities, in any field.
Field search
field:valueRestricts the search to a specific field name. The field name lookup is case-insensitive. The value is matched with icontains (case-insensitive substring) by default.
city:Paris
city:paris
city:PARISAll three return the same results.
status:active
severity:critical
owner:jeanAND / OR on field searches
city:Paris AND status:activeActive instances located in Paris.
country:France OR country:GermanyInstances in France or Germany.
status:active AND city:Lyon OR city:ParisEvaluated left-to-right: (status:active AND city:Lyon) OR city:Paris.
NOT status:disabled AND severity:criticalCritical instances that are not disabled.
Wildcard search
Append or prepend * to restrict how the value is matched.
| Pattern | Django lookup | Example |
|---|---|---|
value* |
istartswith |
city:Par* → Paris, Parma, Parthenay |
*value |
iendswith |
city:*olis → Annapolis, Minneapolis |
*value* |
icontains |
city:*ari* → Paris, Bari, Marie |
hostname:web*All instances whose hostname field starts with “web”.
hostname:*-prodAll instances whose hostname ends with “-prod”.
tag:*monitoring*Instances tagged with anything containing “monitoring”.
hostname:web* AND env:productionProduction web servers.
hostname:web* OR hostname:app*Web or app servers.
NOT hostname:*-devEverything that is not a dev server.
Quoted values
Use double or single quotes to search for values that contain spaces. The colon and quotes are part of the token — the tokenizer handles them transparently.
city:"Le Mans"
city:'Le Mans'
owner:"Jean Martin"
description:"high availability"Quotes can be combined with wildcards:
owner:"Jean*"Note: The POST request validator accepts
",',*,>,<,=,-in addition to standard alphanumeric characters.
Numeric comparisons
Use >=, >, <=, < before the value. The EAV value is cast to a float in the database for comparison. Works on int and float field types.
pop:>=1000000
pop:>500
pop:<=100
pop:<50score:>=90 AND score:<=100Score between 90 and 100.
count:>0 AND status:activeActive instances with a non-zero count.
disk_gb:>=500 AND disk_gb:<2000Disk between 500 GB and 2 TB.
NOT disk_gb:>=1000Instances with disk under 1 TB (or no disk field).
Date and datetime comparisons
EAV date fields (regular schema fields of date/datetime dataformat, stored as strings) stored in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS) compare correctly with lexicographic ordering.
last_seen:>="2025-06-01" AND last_seen:<"2025-07-01"Seen in June 2025.
expiry:<"2026-04-25"Expired before today.
NOT expiry:>="2025-01-01"Instances that expired before 2025 (or have no expiry value set — they have no EAV row and will be included).
Use
EXISTS:expiry AND NOT expiry:>="2025-01-01"to restrict to instances that have anexpiryvalue but it is before 2025.
last_syncandlast_updateare different. They are built-inDataInstancecolumns (meta fields), not EAV fields, and use real datetime parsing rather than lexicographic string comparison — see Meta fields → last_sync / last_update below.
Existence and emptiness
For regular EAV fields, the EAV cache only stores non-empty values, so a field with an empty or missing value has no EAV row. last_sync/last_update are the one exception — see the note below.
EXISTS
EXISTS:serial_numberInstances that have a non-empty value set for serial_number.
NOT EXISTS:serial_numberInstances where serial_number is not set (equivalent to EMPTY:serial_number).
EXISTS:serial_number AND status:activeActive instances that have a serial number.
EXISTS:expiry AND expiry:<"2025-01-01"Instances with an expiry value older than 2025.
EMPTY
EMPTY:ownerInstances where owner has no value set (same as NOT EXISTS:owner).
NOT EMPTY:ownerInstances with a non-empty owner value (same as EXISTS:owner).
EMPTY:owner AND status:criticalCritical instances with no owner assigned.
NOT EMPTY:serial_number AND NOT EMPTY:warranty_endInstances that have both a serial number and a warranty end date.
EXISTS:last_sync/EMPTY:last_sync(andlast_update) work the same way but check the realDataInstancecolumn directly (IS NOT NULL/IS NULL), not EAV-row presence — see below.
Meta fields
These fields map directly to DataInstance columns and bypass the EAV cache entirely, so they are always accurate.
is_enabled
is_enabled:True
is_enabled:Falseis_enabled:False AND severity:criticalDisabled critical instances.
NOT is_enabled:TrueSame as is_enabled:False.
keyname
keyname:srv-paris-01
keyname:srv*
keyname:*-prod
keyname:*web*keyname:web* AND is_enabled:TrueEnabled instances whose key starts with “web”.
displayname
displayname:Paris
displayname:*Server*
displayname:"Main DC"last_sync / last_update
last_sync and last_update are DateTimeField columns on DataInstance — not EAV fields — so they are always accurate and never depend on cavaliba cache --eav_refresh. last_update is set automatically on every save; last_sync is set explicitly (e.g. by an import job) and stays empty until then.
Unlike other meta fields, comparisons use real datetime parsing, not string matching:
>,>=,<,<=compare against the parsed date/datetime.- A bare value with no operator (
last_sync:2026-02-15) matches the entire day, not a substring. - The value must be a full ISO date or datetime —
YYYY-MM-DDorYYYY-MM-DDTHH:MM:SS(with optional timezone). A partial value likelast_sync:>2026-02fails to parse and silently matches nothing — always give the day.
last_sync:>="2026-02-01"Synced on or after 2026-02-01.
last_sync:<"2026-02-01"Synced strictly before 2026-02-01. Instances with no last_sync at all are excluded (NULL < date is never true) — combine with EMPTY: to also catch never-synced instances:
last_sync:<"2026-02-01" OR EMPTY:last_synclast_sync:2026-02-15Synced at any time on 2026-02-15 (whole-day match).
EXISTS:last_sync AND last_sync:<"2025-01-01"Instances that have synced at least once, but not since 2025.
NOT EXISTS:last_updateInstances never saved at all — rare, since last_update is set on every save.
Schema field name collision. A schema is technically allowed to define its own EAV field literally named
last_syncorlast_update. In that case, for searches scoped to that schema (i.e.classnameis set — the normalinstance_listcase), the schema’s own EAV field takes precedence over the built-in column. Cross-schema searches (no singleclassname) always resolve to the built-in column. Avoid naming a custom fieldlast_sync/last_updateto sidestep the ambiguity.
Related instances
The RELATED: keyword lists instances of the current schema that reference a specific object in another schema. This filter is also applied automatically when clicking the Related Objects badge on an instance detail page.
RELATED:<classname>:<keyname>RELATED:site:paris-01All instances (in the current schema) that reference paris-01 from the site schema.
RELATED:customer:acme-corpAll assets assigned to ACME Corp.
RELATED:is a standalone query — it cannot be combined with AND/OR/NOT in the current version.
The lowercase formrelated:is still accepted for backward compatibility.
Combining everything — real-world examples
hostname:web* AND is_enabled:True AND EXISTS:last_syncEnabled web servers that have been synced at least once.
status:critical OR status:warningInstances in a critical or warning state.
NOT is_enabled:True AND EMPTY:ownerDisabled instances with no owner assigned — good for cleanup.
env:production AND NOT EXISTS:backup_policyProduction instances missing a backup policy.
pop:>=100000 AND country:FranceFrench cities with population ≥ 100,000.
last_sync:<"2025-01-01" AND is_enabled:TrueStill-enabled instances not synced since 2025.
hostname:*-prod AND disk_gb:>=500 AND EXISTS:backup_policyLarge production servers that have a backup policy defined.
severity:critical AND NOT EMPTY:assignee AND status:openOpen critical tickets already assigned to someone.
NOT EXISTS:serial_number OR NOT EXISTS:warranty_endInstances missing either a serial number or a warranty date (for audit).
Limitations
- EAV cache must be fresh. Field-level searches (
field:value,EXISTS:,EMPTY:, comparisons) depend on the EAV cache. Runcavaliba cache --eav_refreshafter bulk data changes. The meta fields (is_enabled,keyname,displayname,last_sync,last_update) are always accurate — they read theDataInstancecolumns directly. last_sync/last_updateneed a full date.last_sync:>2026-02(year-month only) fails to parse and silently matches nothing — uselast_sync:>2026-02-01.- Instances with no fields (no EAV rows at all) will not appear in field-level or full-text searches. They are visible only in unfiltered listings.
- No parentheses. Complex filters like
(A AND B) OR Care not supported. Rewrite asA OR C AND B OR Cor split into multiple searches. RELATED:is standalone. It cannot be combined with AND/OR/NOT. Lowercaserelated:is accepted for backward compatibility.- Wildcards at boundaries only.
city:*par*is*is treated asicontainsonpar*is, not as a multi-anchor glob. - Numeric cast errors. If a non-numeric string is stored in a numeric field and a comparison operator is used, the comparison falls back to lexicographic string ordering.