Skip to content

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.

Choose filter syntax for the person or program writing the query.

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.

FILTER FORMATWho writes it?FleXcn is JohnJSON{"cn":"John"}SCIMcn eq "John"LDAP(cn=John)Query enginesame resultsby handin codeSCIM toolsLDAP toolssame conditions
FILTER FORMATWho writes it?FleXcn is JohnJSON{"cn":"John"}SCIMcn eq "John"LDAP(cn=John)Query enginesame resultsby handin codeSCIM toolsLDAP toolssame conditions
Choose the filter syntax your caller can write; equivalent conditions in any format query the same data.

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 reads like plain English. It’s the most natural format for config files, interactive queries, and curl one-liners.

cn is John
department is Engineering and active is true
cn|mail starts with john

FleX 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 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

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

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

FleX and JSON support attribute groups: one condition over several attributes.

OR · ANY OFcn|mail|uid = johnone conditioncn = johnmail = johnuid = johnEntry matchesexpands toany match
OR · ANY OFcn|mail|uid = johnone conditioncn = johnmail = johnuid = johnEntry matchesexpands toany match
An attribute group means any listed attribute may match the condition.
cn|mail|uid = john # FleX
{"cn|mail|uid": "john"} # JSON

LDAP and SCIM spell out the same OR:

cn = john or mail = john or uid = john # FleX
(|(cn=john)(mail=john)(uid=john)) # LDAP
FormatDetected byAttr groupsSet membershipBest for
FleXDefaultYesYesConfig files, interactive use, curl
JSONWrapped in {…} or […]YesYesApplication code, SDKs
SCIMFallback——SCIM ecosystem tools
LDAPStarts with (cn=, (&(, …——Existing queries, LDAP clients