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