Scripting Functions
Scripting Functions
Section titled “Scripting Functions”This generated catalog lists the public host functions available to the Script action (script) and Java Script action (java-script). Runtime names and return values can differ.
Conditionals
Section titled “Conditionals”Alias for condn.
- Lua:
case - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
condition_value_pairs |
any... |
Alternating conditions and result values. |
coalesce
Section titled “coalesce”Return the first value that is not null.
- Lua:
coalesce - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
any... |
Candidate values. |
Select one of two values.
- Lua:
cond - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
condition |
boolean |
Branch condition. | |
when_true |
any |
Value returned when true. | |
when_false |
any |
Value returned when false. |
Return the value paired with the first true condition.
- Lua:
condn - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
condition_value_pairs |
any... |
Alternating conditions and result values. |
Alias for cond.
- Lua:
iif - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
condition |
boolean |
Branch condition. | |
when_true |
any |
Value returned when true. | |
when_false |
any |
Value returned when false. |
Cryptography
Section titled “Cryptography”decrypt
Section titled “decrypt”Auto-detect and decrypt supported symmetric ciphertext formats.
- Lua:
decrypt - JavaScript:
decrypt - Lua returns:
string - JavaScript returns:
string - Feature:
aead|legacy-cbc
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
blob |
string |
Versioned ciphertext. | |
key |
string |
Secret key material. |
decrypt_age
Section titled “decrypt_age”Decrypt ASCII-armored age data.
- Lua:
decrypt_age - JavaScript:
decryptAge - Lua returns:
string - JavaScript returns:
string - Feature:
age
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
blob |
string |
ASCII-armored age ciphertext. | |
identities |
`string | string[]` |
decrypt_auto
Section titled “decrypt_auto”Auto-detect and decrypt supported symmetric ciphertext formats.
- Lua:
decrypt_auto - JavaScript:
decryptAuto - Lua returns:
string - JavaScript returns:
string - Feature:
aead|legacy-cbc
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
blob |
string |
Versioned ciphertext. | |
key |
string |
Secret key material. |
decrypt_symmetric
Section titled “decrypt_symmetric”Decrypt a versioned AEAD ciphertext.
- Lua:
decrypt_s - JavaScript:
decryptS - Lua returns:
string - JavaScript returns:
string - Feature:
aead
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
blob |
string |
Versioned AEAD ciphertext. | |
key |
string |
Secret key material. |
decrypt_with
Section titled “decrypt_with”Decrypt an HPKE ciphertext with an X25519 private key.
- Lua:
decrypt_with - JavaScript:
decryptWith - Lua returns:
string - JavaScript returns:
string - Feature:
hpke
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
blob |
string |
HPKE ciphertext. | |
recipient_private_key |
string |
Base64 X25519 recipient private key. |
encrypt
Section titled “encrypt”Encrypt text with the default versioned AEAD format.
- Lua:
encrypt - JavaScript:
encrypt - Lua returns:
string - JavaScript returns:
string - Feature:
aead
This compatibility name uses the modern AEAD format; prefer encrypt_s/encryptS when the algorithm choice should be explicit. JavaScript throws when encryption fails or the aead build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Plaintext. | |
key |
string |
Secret key material. |
encrypt_age
Section titled “encrypt_age”Encrypt text as ASCII-armored age data.
- Lua:
encrypt_age - JavaScript:
encryptAge - Lua returns:
string - JavaScript returns:
string - Feature:
age
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Plaintext. | |
recipients |
`string | string[]` |
encrypt_for
Section titled “encrypt_for”Encrypt text for an X25519 recipient with HPKE.
- Lua:
encrypt_for - JavaScript:
encryptFor - Lua returns:
string - JavaScript returns:
string - Feature:
hpke
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Plaintext. | |
recipient_public_key |
string |
Base64 X25519 recipient public key. |
encrypt_symmetric
Section titled “encrypt_symmetric”Encrypt text with a selected versioned AEAD scheme.
- Lua:
encrypt_s - JavaScript:
encryptS - Lua returns:
string - JavaScript returns:
string - Feature:
aead
JavaScript throws when the operation fails or its build feature is unavailable. Lua instead writes an error to worker stderr and returns an empty string; Lua jobs must reject an empty result rather than treating it as ciphertext or plaintext.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Plaintext. | |
key |
string |
Secret key material. | |
scheme |
string |
Yes | aes256gcm or the default chacha20poly1305. |
hmac_sha256
Section titled “hmac_sha256”Return the lowercase hexadecimal HMAC-SHA256 tag for UTF-8 text.
- Lua:
hmac_sha256 - JavaScript:
hmacSha256 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
UTF-8 key bytes. | |
text |
string |
UTF-8 message bytes. |
hmac_sha256_base64
Section titled “hmac_sha256_base64”Decode the message from standard padded base64 and return its lowercase hexadecimal HMAC-SHA256 tag.
- Lua:
hmac_sha256_base64 - JavaScript:
hmacSha256Base64 - Lua returns:
string - JavaScript returns:
string
Only the message argument is base64. The key is UTF-8 text and the returned tag is hexadecimal. Invalid message base64 raises a bounded script error.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
UTF-8 key bytes. | |
message_base64 |
string |
Message bytes encoded as standard padded base64. |
hmac_sha256_verify_base64
Section titled “hmac_sha256_verify_base64”Verify an HMAC-SHA256 tag in constant time after decoding the message from standard padded base64.
- Lua:
hmac_sha256_verify_base64 - JavaScript:
verifyHmacSha256Base64 - Lua returns:
boolean - JavaScript returns:
boolean
Only the message argument is base64. The key is UTF-8 text and the expected tag is exactly 64 hexadecimal characters, without a sha256= prefix. Malformed inputs return false.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
UTF-8 key bytes. | |
message_base64 |
string |
Message bytes encoded as standard padded base64. | |
expected_hex |
string |
Exactly 64 hexadecimal tag characters with no algorithm prefix. |
Encoding
Section titled “Encoding”decode_base64
Section titled “decode_base64”Decode standard base64 as a lossy UTF-8 string.
- Lua:
decode_base64 - JavaScript:
decodeBase64 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Base64 text to decode. |
encode_base64
Section titled “encode_base64”Encode text with standard base64.
- Lua:
encode_base64 - JavaScript:
encodeBase64 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Text bytes to encode. |
Identity & hashing
Section titled “Identity & hashing”Return the lowercase hexadecimal MD5 digest.
- Lua:
md5 - JavaScript:
md5 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Text to hash. |
Return the lowercase hexadecimal SHA-1 digest.
- Lua:
sha1 - JavaScript:
sha1 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Text to hash. |
sha256
Section titled “sha256”Return the lowercase hexadecimal SHA-256 digest.
- Lua:
sha256 - JavaScript:
sha256 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Text to hash. |
sha512
Section titled “sha512”Return the lowercase hexadecimal SHA-512 digest.
- Lua:
sha512 - JavaScript:
sha512 - Lua returns:
string - JavaScript returns:
string
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
string |
Text to hash. |
Generate a random UUID v4.
- Lua:
uuid - JavaScript:
uuid - Lua returns:
string - JavaScript returns:
string
Return the absolute value.
- Lua:
abs - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
number |
Number. |
Round upward to an integer.
- Lua:
ceil - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
number |
Number. |
Round downward to an integer.
- Lua:
floor - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
number |
Number. |
pick_random
Section titled “pick_random”Return one seeded pseudo-random argument.
- Lua:
pick_random - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
any... |
Candidate values. |
Return a seeded pseudo-random integer from 1 through the upper bound.
- Lua:
rand - JavaScript: Not available
- Lua returns:
integer - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
upper_bound |
integer |
Inclusive upper bound. |
Round a number to the nearest integer.
- Lua:
round - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
number |
Number to round. |
Multivalue
Section titled “Multivalue”mvappend
Section titled “mvappend”Append scalar and table arguments into one multivalue table.
- Lua:
mvappend - JavaScript: Not available
- Lua returns:
table - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
any... |
Scalars or tables to flatten one level. |
mvcount
Section titled “mvcount”Count values in a multivalue field.
- Lua:
mvcount - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` |
mvdedup
Section titled “mvdedup”Remove duplicate multivalue elements while preserving first-seen order.
- Lua:
mvdedup - JavaScript: Not available
- Lua returns:
table - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` |
mvindex
Section titled “mvindex”Read a value at a zero-based multivalue index.
- Lua:
mvindex - JavaScript: Not available
- Lua returns:
any|nil - JavaScript returns: Not available
Negative indexes count from the end.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` | |
index |
integer |
Zero-based index. |
mvjoin
Section titled “mvjoin”Join multivalue elements with a delimiter.
- Lua:
mvjoin - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` | |
delimiter |
any |
Delimiter converted to text. |
mvsort
Section titled “mvsort”Stable-sort multivalue elements by their text representation.
- Lua:
mvsort - JavaScript: Not available
- Lua returns:
table - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` |
Network
Section titled “Network”Test whether an IP address belongs to a CIDR network.
- Lua:
cidr - JavaScript:
cidr - Lua returns:
boolean - JavaScript returns:
boolean
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
ip |
string |
IPv4 or IPv6 address. | |
network |
string |
CIDR network specification. |
Return the one-based number of events processed by this script instance.
- Lua:
count - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
local_get
Section titled “local_get”Read from the Lua script instance’s local cache.
- Lua:
local_get - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Unlike store_get, this cache is local to one initialized Lua action instance.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
Local cache key. | |
default |
any |
Yes | Value returned when absent. |
local_set
Section titled “local_set”Conditionally write the Lua script instance’s local cache.
- Lua:
local_set - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
Local cache key. | |
condition |
boolean |
Write only when true. | |
value |
any |
Value to store. |
store_get
Section titled “store_get”Read a value from the job’s cross-event string store.
- Lua:
store_get - JavaScript:
storeGet - Lua returns:
string - JavaScript returns:
string
The store is shared by the Lua and JavaScript actions for the same runtime job.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
Store key. | |
default |
string |
Yes | Value returned when the key is absent. |
store_set
Section titled “store_set”Conditionally write the job’s cross-event string store.
- Lua:
store_set - JavaScript:
storeSet - Lua returns:
string - JavaScript returns:
string
When condition is false, the existing value is returned, or an empty string when the key is absent.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key |
string |
Store key. | |
condition |
boolean |
Write only when true. | |
value |
string |
Value to store. |
Accumulate a numeric value by name within the Lua script instance.
- Lua:
sum - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
An omitted or true condition adds value to the named accumulator. A false condition clears the stored accumulator to zero and returns the supplied value.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
accumulator |
string |
Accumulator name. | |
value |
number |
Value to add. | |
condition |
boolean |
Yes | When false, reset the accumulator to zero and return value without adding it. |
Strings
Section titled “Strings”contains
Section titled “contains”Test whether text contains a literal substring.
- Lua:
contains - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
needle |
any |
Literal value to find. |
endswith
Section titled “endswith”Test whether text ends with a literal suffix.
- Lua:
endswith - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
suffix |
any |
Suffix converted to text. |
Join values with a delimiter.
- Lua:
join - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
`table | any` | |
delimiter |
any |
Delimiter converted to text. |
Test text against a SQL-like pattern.
- Lua:
like - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
pattern |
string |
SQL-like pattern using % and _. |
Convert text to lowercase.
- Lua:
lower - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. |
Remove leading whitespace.
- Lua:
ltrim - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. |
Test text against a regular expression.
- Lua:
match - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
pattern |
string |
Rust regular expression. |
replace
Section titled “replace”Replace all regular-expression matches.
- Lua:
replace - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Backslash-number captures are translated to Rust regex replacement syntax.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
pattern |
string |
Rust regular expression. | |
replacement |
string |
Yes | Replacement text. |
Remove trailing whitespace.
- Lua:
rtrim - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. |
Split text on a literal delimiter.
- Lua:
split - JavaScript: Not available
- Lua returns:
table|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
delimiter |
any |
Non-empty literal delimiter. |
startswith
Section titled “startswith”Test whether text starts with a literal prefix.
- Lua:
startswith - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
prefix |
any |
Prefix converted to text. |
substr
Section titled “substr”Extract a UTF-8 substring by start index and length.
- Lua:
substr - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Negative start indexes count from the end.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
start |
integer |
Yes | Zero-based start index; defaults to 0. |
length |
integer |
Yes | Maximum number of characters. |
substring
Section titled “substring”Extract a UTF-8 substring by start and exclusive end indexes.
- Lua:
substring - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Negative indexes count from the end.
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. | |
start |
integer |
Yes | Zero-based start index; defaults to 0. |
end |
integer |
Yes | Exclusive zero-based end index. |
Remove leading and trailing whitespace.
- Lua:
trim - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. |
Convert text to uppercase.
- Lua:
upper - JavaScript: Not available
- Lua returns:
string|nil - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
text |
any |
Value converted to text. |
Telemetry
Section titled “Telemetry”batch_number
Section titled “batch_number”Return the current batch number.
- Lua:
batch_number - JavaScript:
batchNumber - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
batch_number_string
Section titled “batch_number_string”Return the current batch number as decimal text.
- Lua: Not available
- JavaScript:
batchNumberStr - Lua returns: Not available
- JavaScript returns:
string
error_count
Section titled “error_count”Return the current job error count.
- Lua:
error_count - JavaScript:
errorCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
error_count_string
Section titled “error_count_string”Return the current job error count as decimal text.
- Lua: Not available
- JavaScript:
errorCountStr - Lua returns: Not available
- JavaScript returns:
string
filtered_events
Section titled “filtered_events”Return the current job filtered event count.
- Lua:
filtered_events - JavaScript:
filteredEvents - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
filtered_events_string
Section titled “filtered_events_string”Return the current job filtered event count as decimal text.
- Lua: Not available
- JavaScript:
filteredEventsStr - Lua returns: Not available
- JavaScript returns:
string
input_byte_count
Section titled “input_byte_count”Return the current job input byte count.
- Lua:
input_byte_count - JavaScript:
inputByteCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
input_byte_count_string
Section titled “input_byte_count_string”Return the current job input byte count as decimal text.
- Lua: Not available
- JavaScript:
inputByteCountStr - Lua returns: Not available
- JavaScript returns:
string
input_event_count
Section titled “input_event_count”Return the current job input event count.
- Lua:
input_event_count - JavaScript:
inputEventCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
input_event_count_string
Section titled “input_event_count_string”Return the current job input event count as decimal text.
- Lua: Not available
- JavaScript:
inputEventCountStr - Lua returns: Not available
- JavaScript returns:
string
output_byte_count
Section titled “output_byte_count”Return the current job output byte count.
- Lua:
output_byte_count - JavaScript:
outputByteCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
output_byte_count_string
Section titled “output_byte_count_string”Return the current job output byte count as decimal text.
- Lua: Not available
- JavaScript:
outputByteCountStr - Lua returns: Not available
- JavaScript returns:
string
output_event_count
Section titled “output_event_count”Return the current job output event count.
- Lua:
output_event_count - JavaScript:
outputEventCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
output_event_count_string
Section titled “output_event_count_string”Return the current job output event count as decimal text.
- Lua: Not available
- JavaScript:
outputEventCountStr - Lua returns: Not available
- JavaScript returns:
string
run_count
Section titled “run_count”Return the job run count.
- Lua:
run_count - JavaScript:
runCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_count_string
Section titled “run_count_string”Return the job run count as decimal text.
- Lua: Not available
- JavaScript:
runCountStr - Lua returns: Not available
- JavaScript returns:
string
run_filtered_events
Section titled “run_filtered_events”Return the current run filtered event count.
- Lua:
run_filtered_events - JavaScript:
runFilteredEvents - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_filtered_events_string
Section titled “run_filtered_events_string”Return the current run filtered event count as decimal text.
- Lua: Not available
- JavaScript:
runFilteredEventsStr - Lua returns: Not available
- JavaScript returns:
string
run_input_byte_count
Section titled “run_input_byte_count”Return the current run input byte count.
- Lua:
run_input_byte_count - JavaScript:
runInputByteCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_input_byte_count_string
Section titled “run_input_byte_count_string”Return the current run input byte count as decimal text.
- Lua: Not available
- JavaScript:
runInputByteCountStr - Lua returns: Not available
- JavaScript returns:
string
run_input_event_count
Section titled “run_input_event_count”Return the current run input event count.
- Lua:
run_input_event_count - JavaScript:
runInputEventCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_input_event_count_string
Section titled “run_input_event_count_string”Return the current run input event count as decimal text.
- Lua: Not available
- JavaScript:
runInputEventCountStr - Lua returns: Not available
- JavaScript returns:
string
run_job_errors
Section titled “run_job_errors”Return the current run error count.
- Lua:
run_job_errors - JavaScript:
runJobErrors - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_job_errors_string
Section titled “run_job_errors_string”Return the current run error count as decimal text.
- Lua: Not available
- JavaScript:
runJobErrorsStr - Lua returns: Not available
- JavaScript returns:
string
run_job_warnings
Section titled “run_job_warnings”Return the current run warning count.
- Lua:
run_job_warnings - JavaScript:
runJobWarnings - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_job_warnings_string
Section titled “run_job_warnings_string”Return the current run warning count as decimal text.
- Lua: Not available
- JavaScript:
runJobWarningsStr - Lua returns: Not available
- JavaScript returns:
string
run_output_byte_count
Section titled “run_output_byte_count”Return the current run output byte count.
- Lua:
run_output_byte_count - JavaScript:
runOutputByteCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_output_byte_count_string
Section titled “run_output_byte_count_string”Return the current run output byte count as decimal text.
- Lua: Not available
- JavaScript:
runOutputByteCountStr - Lua returns: Not available
- JavaScript returns:
string
run_output_event_count
Section titled “run_output_event_count”Return the current run output event count.
- Lua:
run_output_event_count - JavaScript:
runOutputEventCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
run_output_event_count_string
Section titled “run_output_event_count_string”Return the current run output event count as decimal text.
- Lua: Not available
- JavaScript:
runOutputEventCountStr - Lua returns: Not available
- JavaScript returns:
string
warning_count
Section titled “warning_count”Return the current job warning count.
- Lua:
warning_count - JavaScript:
warningCount - Lua returns:
integer - JavaScript returns:
number
Lua returns an integer. JavaScript returns a Number, which can lose integer precision above Number.MAX_SAFE_INTEGER; use the corresponding JavaScript …Str helper when exact decimal text is required.
warning_count_string
Section titled “warning_count_string”Return the current job warning count as decimal text.
- Lua: Not available
- JavaScript:
warningCountStr - Lua returns: Not available
- JavaScript returns:
string
job_start_time_milliseconds
Section titled “job_start_time_milliseconds”Return the job start timestamp in milliseconds.
- Lua: Not available
- JavaScript:
jobStartTimeMs - Lua returns: Not available
- JavaScript returns:
number
job_start_time_nanoseconds
Section titled “job_start_time_nanoseconds”Return the job start timestamp in nanoseconds.
- Lua:
job_start_time - JavaScript:
jobStartTimeNs - Lua returns:
integer - JavaScript returns:
string
Lua returns a number. JavaScript returns a decimal string so nanosecond values do not lose precision past Number.MAX_SAFE_INTEGER.
now_milliseconds
Section titled “now_milliseconds”Return the current Unix timestamp in milliseconds.
- Lua:
sec_ms - JavaScript:
nowMs - Lua returns:
number - JavaScript returns:
number
now_seconds
Section titled “now_seconds”Return the current Unix timestamp in seconds.
- Lua:
sec_s - JavaScript:
nowSec - Lua returns:
number - JavaScript returns:
number
run_last_end_time_milliseconds
Section titled “run_last_end_time_milliseconds”Return the previous run start timestamp in milliseconds.
- Lua: Not available
- JavaScript:
runLastEndTimeMs - Lua returns: Not available
- JavaScript returns:
number
Despite the legacy binding name, runtime state currently copies the prior run’s start timestamp into this value when the next run starts.
run_last_end_time_nanoseconds
Section titled “run_last_end_time_nanoseconds”Return the previous run start timestamp in nanoseconds.
- Lua:
run_last_end_time - JavaScript:
runLastEndTimeNs - Lua returns:
integer - JavaScript returns:
string
Despite the legacy binding names, runtime state currently copies the prior run’s start timestamp into this value when the next run starts. Lua returns a number. JavaScript returns decimal text so nanosecond values do not lose precision past Number.MAX_SAFE_INTEGER.
run_start_time_milliseconds
Section titled “run_start_time_milliseconds”Return the current run start timestamp in milliseconds.
- Lua: Not available
- JavaScript:
runStartTimeMs - Lua returns: Not available
- JavaScript returns:
number
run_start_time_nanoseconds
Section titled “run_start_time_nanoseconds”Return the current run start timestamp in nanoseconds.
- Lua:
run_start_time - JavaScript:
runStartTimeNs - Lua returns:
integer - JavaScript returns:
string
Lua returns a number. JavaScript returns a decimal string so nanosecond values do not lose precision past Number.MAX_SAFE_INTEGER.
Values
Section titled “Values”Construct a table marked to round-trip as a JSON array, including when empty.
- Lua:
array - JavaScript: Not available
- Lua returns:
table - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
values |
any... |
Yes | Values to collect. |
is_null
Section titled “is_null”Test whether a value is nil or the scripting NULL sentinel.
- Lua:
is_null - JavaScript: Not available
- Lua returns:
boolean - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
any |
Value to test. |
Return a value unchanged.
- Lua:
json - JavaScript: Not available
- Lua returns:
any - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
any |
Value to return. |
Return the Lua length of a string or table.
- Lua:
len - JavaScript: Not available
- Lua returns:
number - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
value |
`string | table` |
Construct a table from alternating key and value arguments.
- Lua:
map - JavaScript: Not available
- Lua returns:
table - JavaScript returns: Not available
Parameters
Section titled “Parameters”| Name | Type | Optional | Description |
|---|---|---|---|
key_values |
any... |
Yes | Alternating keys and values. |