Choosing a Filter Format
- FleX
For filters people write by hand.
- JSON
For filters assembled in code.
- LDAP or SCIM
For queries from an existing ecosystem.
You can choose a format, then look up its exact syntax.
Next: Filter syntax
Scribe speaks four filter languages: FleX, JSON, SCIM, and LDAP. They differ only in syntax: FleX and JSON add attribute groups and set membership that the others can only express with verbose OR chains.
Scribe auto-detects the format, so you can mix formats freely across requests. All formats support temporal references like now-1h, today, and last 7 days for timestamp filtering. For a side-by-side operator comparison, see Quick comparison. For full syntax with examples and edge cases, see the Filters reference.
FleX — best for humans
Section titled “FleX — best for humans”FleX reads like plain English. It’s the most natural format for config files, interactive queries, and curl one-liners.
cn is Johndepartment is Engineering and active is truecn|mail starts with johnFleX supports attribute groups (cn|mail = john searches both fields with one condition) and set membership (status in (active, pending)). Whitespace around operators is optional but helps readability.
Use FleX when typing queries by hand or embedding filters in config files.
Reference: FleX syntax — operators — combinators — values — set membership
JSON — best for code
Section titled “JSON — best for code”JSON filters are easy to construct programmatically. No escaping headaches, no string concatenation bugs, and your language already has a JSON serializer.
{"cn": "John"}{"department": "Engineering", "active": "true"}{"cn|mail": {"sw": "john"}}JSON also supports attribute groups and set membership ({"status": {"includes": ["active", "pending"]}}). Nested objects map directly to operators (sw, co, ne, pr).
Use JSON when building filters in application code or constructing queries dynamically.
Reference: JSON syntax — operators — logical operators — value coercion
SCIM — for SCIM ecosystems
Section titled “SCIM — for SCIM ecosystems”If your existing tooling speaks SCIM, the filter syntax will feel familiar:
cn eq "John"department eq "Engineering" and active eq "true"SCIM is the fallback format — Scribe tries it last when auto-detecting.
Use SCIM when integrating with SCIM-aware systems or when your team already knows the syntax from other SCIM deployments.
Reference: SCIM syntax — operators — FleX compatibility
LDAP — for existing queries
Section titled “LDAP — for existing queries”Standard LDAP filter syntax, per RFC 4515:
(cn=John*)(&(department=Engineering)(active=TRUE))LDAP filters are auto-detected when the string starts with ( followed directly by an attribute and operator, such as (cn=, or by &(, |( or !(.
Use LDAP when migrating existing queries, working with LDAP clients that construct filters, or interacting through the LDAP channel where clients emit this format natively.
Reference: LDAP syntax — operators — extensible match — migrating to FleX
Attribute groups
Section titled “Attribute groups”FleX and JSON support attribute groups: one condition over several attributes.
cn|mail|uid = john # FleX{"cn|mail|uid": "john"} # JSONLDAP and SCIM spell out the same OR:
cn = john or mail = john or uid = john # FleX(|(cn=john)(mail=john)(uid=john)) # LDAPSummary
Section titled “Summary”| Format | Detected by | Attr groups | Set membership | Best for |
|---|---|---|---|---|
| FleX | Default | Yes | Yes | Config files, interactive use, curl |
| JSON | Wrapped in {…} or […] | Yes | Yes | Application code, SDKs |
| SCIM | Fallback | — | — | SCIM ecosystem tools |
| LDAP | Starts with (cn=, (&(, … | — | — | Existing queries, LDAP clients |