json

Generates the data source using the JSON string. Typically, this command is used to test the operation of the query command that follows.

Syntax

json JSON_DATA
Required Parameter
JSON_DATA
JSON string enclosed in a pair of double quotes (" "), or an expression that returns a JSON formatted string. If the JSON string has double quotes ("), it must be escaped with a backslash like this: (\").

Usage

  1. Generate a log with “a” => 8, “b” => "miles” key-value pairs.

    json "{ 'a': 8, 'b':'miles' }"
    
  2. Generate the “a” => 8, “b” => "miles" log and “a” => 2, “b” => "cats" log.

    json "[{ 'a': 8, 'b':'miles' }, { 'a': 2, 'b':'cats' }]"