'Pretty prints' a JSON field. The function formats a JSON field for improved readability. This can be an expensive operation.
It is recommended to apply
json:prettyPrint()
after filtering your
data at the end of the query. This prevents unnecessary
formatting of data that will be discarded.
Default behaviour is as follows:
If the field does not contain valid JSON, the unmodified input value is stored in the output field.
If no field is specified, the @rawstring field will be formatted.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
as | string | optional[a] | The name of the field to store the output in. | |
field [b] | string | optional[a] | @rawstring | The name of the field to format. |
step | number | optional[a] | 2 | The indentation in number of characters, minimum 2 spaces. |
strict | boolean | optional[a] | false | If set to true only valid JSON input produce a value in the output field. By default invalid JSON is copied to the output field unmodified. |
[a] Optional parameters use their default value unless explicitly set. |
Hide omitted argument names for this function
Omitted Argument NamesThe argument name for
field
can be omitted; the following forms of this function are equivalent:logscale Syntaxjson:prettyPrint("value")
and:
logscale Syntaxjson:prettyPrint(field="value")
These examples show basic structure only.