TheDcoder TheDcoder - 1 year ago 105
JSON Question

What is the correct syntax for jq?

Is there a commandline documentation to use

? I am currently running this command:

%jq% -f JSON.txt -r ".sm_api_content"

It is supposed to read from
and to output the value of
(which is a string).

But I am getting this error:

%jq% -f JSON.txt -r ".sm_api_content"

Can anyone help me out here?

Answer Source

-f is for specifying a filename to read your "filter" from - in this case .sm_api_content

It sounds as if you just want to run jq normally e.g.

jq -r .sm_api_content JSON.txt
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download