Skip to content

[SC-25388] docs(logs): rewrite Script Field Processor page for CEL#730

Open
codeParyul wants to merge 1 commit into
masterfrom
par_SC-25388_docs-script-field-cel
Open

[SC-25388] docs(logs): rewrite Script Field Processor page for CEL#730
codeParyul wants to merge 1 commit into
masterfrom
par_SC-25388_docs-script-field-cel

Conversation

@codeParyul

@codeParyul codeParyul commented Jul 2, 2026

Copy link
Copy Markdown

Goal

The SCRIPT_FIELD pipeline processor engine moved from Painless to CEL — Common Expression Language (SC-25285, sematext-cloud PR #8149). This rewrites https://sematext.com/docs/logs/script-field-processor/ to match the deployed engine, alongside the editor update in sematext-cloud PR #8210 (SC-25388).

Changes

  • Language is CEL (linked to https://cel.dev/), a single expression per script.
  • doc['field'] / doc.field access; bracket form for dotted names; missing fields read as null.
  • Numeric fields need explicit int() / double() conversion — log bodies are decoded with UseNumber, so numbers reach CEL string-backed; bare doc['size'] * 2 fails at runtime. All numeric examples show the conversion.
  • has() presence test, with doc['os.host'] != null for dotted names (has() can't take bracket syntax).
  • String helpers, cel.bind(), and map results setting several fields at once (target then ignored).
  • No loops/comprehensions (rejected at save); runtime script failure leaves the event unchanged, never drops it.
  • Replaced the Painless loop example (inexpressible in CEL) with verified CEL examples — every example on the page was executed against the actual engine environment, including the old page's kb-extraction example, whose substring(17, …) was off by one (produced "42", not "142").

Verification

All claims and examples were validated by running them against the real scriptEnv from go/consumer/cmd/logs/pipelines/proc/script.go (cel-go v0.20.1) with production-shaped (UseNumber-decoded) records.

The SCRIPT_FIELD pipeline processor engine moved from Painless to CEL
(SC-25285). Rewrite the page for CEL: doc['field'] access, explicit
int()/double() conversion for numeric fields (log bodies are decoded
with UseNumber, so numbers reach CEL string-backed), has() presence
test with the != null alternative for dotted names, ext.Strings
helpers, cel.bind, map results setting several fields, single
expression only (no loops/comprehensions), and failure semantics
(failing script leaves the event unchanged). All examples verified
against the deployed engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant