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
| Field | Type | Required | Description |
|---|---|---|---|
entry-point | string | Name of the exported function to invoke (defaults to transform). | |
merge | string | When returning an object, merge strategy to apply (defaults to unless-exists). | |
timeout-ms ✓ | number (integer) | Maximum wall-clock execution time per event in milliseconds. Examples: 42, 1.2e-10 | |
memory-limit-bytes ✓ | number (integer) | Maximum QuickJS heap usage while executing (bytes). Examples: 42, 1.2e-10 |
General
General
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Short summary shown next to the action in the editor. | |
condition | lua-expression (string) | Only run this action if the specified condition is met. Examples: 2 * count() |
Source
Source
| Field | Type | Required | Description |
|---|---|---|---|
source ✓ | lua-expression (string) | Inline JavaScript source. Either source or path must be provided.Examples: 2 * count() | |
path ✓ | file-path (string) | Path (relative to the job workspace) containing the JavaScript source. Examples: /path/to/file, c:\users\joe\data\file.txt |