% BROWSE-JSON(1) Version 3.2.1 | Scripts Documentation % Georg Voell - georg.voell@standby.cloud % (c)2024 Standby.cloud NAME ==== **browse-json** - (BASH Script) Browse through JSON items and print all or single values. SYNOPSIS ======== | **browse-json** \[_options_] \[_key_] DESCRIPTION =========== Browse through JSON items and print all or single values. Options ------- -h, \--help          : Displays helptext. -v, \--version          : Displays the version of the script. -q, \--quiet          : Just write error message to LOGFILE. -r, \--raw          : Don't convert hyphens e.g. lifecycle-state to lifecycleState -o, \--output _string_          : Output format: _string_ can be "json", "keys" or "plain" (default). -i, \--import _string_          : Read from a file (_string_ = filename) - if not specified, read from stdin. -s, \--select _number_          : Select only the nth JSON item (starting with 1 for the first record). Key ------- This script can be called with an optional parameter "key" (otherwise it prints out all keys). EXAMPLES ======== get-platform \--output json | **browse-json** --raw creator get-platform \--output json | **browse-json** --raw content --output json get-platform \--output json | **browse-json** --raw content/processor get-platform \--output json | **browse-json** --select 1 os get-platform \--output json | **browse-json** os get-platform \--output json | **browse-json** [0]/os EXIT CODES ========== 01: Unknown or wrong parameter. 02: No **jq** or wrong version of **jq**. This script needs **jq** to format "json". 03: Error in JSON file or no input. 04: Key not found. 99: User interrupt.