Skip to content

Java Script

Java Script (java-script)

Execute embedded JavaScript to transform events.

Transform Scripting json

Minimal example

actions:
- java-script: {}
JSON
{
"actions": [
{
"java-script": {}
}
]
}

Contents

Execution

Execution
FieldTypeRequiredDescription
entry-pointstringName of the exported function to invoke (defaults to transform).
mergestringWhen returning an object, merge strategy to apply (defaults to unless-exists).
timeout-msnumber (integer)Maximum wall-clock execution time per event in milliseconds.
Examples: 42, 1.2e-10
memory-limit-bytesnumber (integer)Maximum QuickJS heap usage while executing (bytes).
Examples: 42, 1.2e-10

General

General
FieldTypeRequiredDescription
descriptionstringShort summary shown next to the action in the editor.
conditionlua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()

Source

Source
FieldTypeRequiredDescription
sourcelua-expression (string)Inline JavaScript source. Either source or path must be provided.
Examples: 2 * count()
pathfile-path (string)Path (relative to the job workspace) containing the JavaScript source.
Examples: /path/to/file, c:\users\joe\data\file.txt