Overview
Log schemas modify matching Connector and Endpoint logs before Formal stores or exports them. Use schemas to remove, encrypt, truncate, or sanitize sensitive fields with field-level precision. Configure them with theformal_log_schema
Terraform resource. Each schema contains:
- A CEL scope that selects logs.
- One or more protobuf field paths.
- One or more actions for each path.
- An optional asymmetric encryption key.
Configure a Log Schema
This example removes SQL literals from queries for one resource:terraform apply, then query the resource through Formal.
Verify:
Open Logs and inspect the resulting request log.
The query has values_stripped: true and does not contain its original literals.
Scope Fields
Thescope_cel expression must return a boolean. It can use these fields:
The scope cannot inspect payload fields, timestamps, or the complete log. Use
paths to select payload fields after the scope matches.
Endpoint schemas use
log.source == "endpoint". Stored Endpoint logs use
source:desktop when you search them.Schema Actions
encrypt and encrypt_sql require encryption_key_id. The key must use an
asymmetric algorithm. See Encryption Keys.
You can combine compatible actions on one path. drop takes precedence over
every other action. Truncation runs before encryption. SQL stripping runs before
SQL encryption.
Supported Paths
Every path starts withlog. The following path families support schema actions:
encrypt and truncate only support singular string fields. drop can select
a supported parent field, string, list, or map.
Paths use protobuf field names, not search aliases. For example, use
log.request.http.body.received, not request_body.
Path Restrictions
A schema cannot contain both a parent path and its child. For example, you cannot combinelog.request.http.body with
log.request.http.body.received.
Do not configure overlapping paths across separate schemas.
When any schema matches, its path actions replace legacy log content settings
for that log. Existing policy evaluation input retention settings still apply.
If no schema matches, Formal applies the legacy log configuration.
Failure Behavior
Formal clears a selected sensitive field if its encryption action fails. It then continues applying actions to other paths. A failed SQL encryption clears the complete selected query object. A scope evaluation failure skips only that schema. Other matching schemas continue to apply.Next Steps
Configure Encryption Keys
Register an asymmetric key for encrypted fields
Log Configuration
Configure default logging and retention behavior