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

Fields

FieldTypeRequiredDescription
description GeneralstringShort summary shown next to the action in the editor.
condition Generallua-expression (string)Only run this action if the specified condition is met.
Examples: 2 * count()
source Sourcelua-expression (string)Inline JavaScript source. Either source or path must be provided.
Examples: 2 * count()
path Sourcefile-path (string)Path (relative to the job workspace) containing the JavaScript source.
Examples: /path/to/file, c:\users\joe\data\file.txt
entry-point ExecutionstringName of the exported function to invoke (defaults to transform).
merge ExecutionstringWhen returning an object, merge strategy to apply (defaults to unless-exists).
timeout-ms Executionnumber (integer)Maximum wall-clock execution time per event in milliseconds.
Examples: 42, 1.2e-10
memory-limit-bytes Executionnumber (integer)Maximum QuickJS heap usage while executing (bytes).
Examples: 42, 1.2e-10

General

Show fields
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

Show fields
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

Execution

Show fields
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