[SC-25388] docs(logs): rewrite Script Field Processor page for CEL#730
Open
codeParyul wants to merge 1 commit into
Open
[SC-25388] docs(logs): rewrite Script Field Processor page for CEL#730codeParyul wants to merge 1 commit into
codeParyul wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
doc['field']/doc.fieldaccess; bracket form for dotted names; missing fields read asnull.int()/double()conversion — log bodies are decoded withUseNumber, so numbers reach CEL string-backed; baredoc['size'] * 2fails at runtime. All numeric examples show the conversion.has()presence test, withdoc['os.host'] != nullfor dotted names (has()can't take bracket syntax).cel.bind(), and map results setting several fields at once (target then ignored).substring(17, …)was off by one (produced "42", not "142").Verification
All claims and examples were validated by running them against the real
scriptEnvfromgo/consumer/cmd/logs/pipelines/proc/script.go(cel-go v0.20.1) with production-shaped (UseNumber-decoded) records.