eval()

Note: the eval() function depends on scalar functions and operators, which is currently beta functionality, and may change in the future!

eval([...col = expression]) runs each expression and assigns it to the corresponding col.

expression supports any composition of scalar functions and operators.

Currently, scalar expressions can express more data types than table values can. Hence, at assignment, scalar expression values are converted back to table values as such:

  • numbers, strings, and null values are preserved

  • boolean values are converted to the strings "true" and "false"

  • arrays are converted to a string via JSON serialization

Note: This conversion behavior may change when direct support for these types is added to tables.

Returns

A same table as the input, with additional columns corresponding to the cols specified.

Examples

Get a list of HTTP 502s, converting the elapsed time from milliseconds to seconds.

response.status=502
| eval elapsed_s = request.elapsed_ms / 1000

Last updated

Was this helpful?