...
Split a JSON (column) object into multiple fields, where the new field names consist of the input field name followed by underscore (_) followed by the JSON field ID.
Operator Usage in Easy Mode
- Click + on the parent node.
- Enter JSON to Columns operator in the search field and select the operator from the Results to open the operator form.
- In the Input Table drop-down, enter or select the table containing the data to run this operator on.
- In the JSON Field drop-down, enter or select the column that splits the JSON objects into multiple columns.
- In the Defaults Field, click Add More to add a string of default field names.
- Click Run to view the result.
- Click Save to add the operator to the playbook.
- Click Cancel to discard the operator form.
Usage Details
LQL Command
Code Block |
---|
jsonToColumns(table, "jsonField") -- with default fields jsonToColumns(table, "jsonField", "a", "test_1") |
...
Output:
A JSON object that is split into multiple columns. Each column is in the form jsonField__id
, where jsonField
is the input field and id
is the JSON ID.
Example
Input
table = github_logs
id | jsonField |
---|---|
id | {"a":{"b":2,"u":1},"e":3} |
id | {"a":{"b":4,"v":9},"c":5,"d":7} |
...