JQ Basic use can refer to this article:
http://blog.chinaunix.net/uid-24774106-id-3830242.html
JQ English document please refer to:
http:// stedolan.github.io/jq/manual/
=================================================================
Basic format:
JQ [parameter list] ' filter condition ' filename or standard input
Example:
jq-c '. Foo ' A.json
or:
Cat A.json | jq-c '. Foo '
=================================================================
Parameter description:
--compact-output/C
By default, JQ formats JSON as a multiline tree output, but sometimes you need to output a JSON string in one row to use this parameter
=================================================================
Filter Description:
. foo,. Foo.bar
Gets the value of the key in JSON to filter out the key value in the multilevel JSON string.
. foo,. Bar
Gets the value of more than one key in JSON at the same time. However, more than one value filtered out will be displayed on multiple lines.
{foo:. Foo, bar:. Bar}
Gets the value of some key in JSON and combines it with a new object-form JSON string. Foo and Bar are the key,.foo of the new JSON string and the. Bar is the key that needs to get the value in the original JSON string.
Note that the generated JSON string is in reverse order, which is generated in the example: {"bar": "", "foo": ""}
[. Foo,. Bar]
Gets the value of some key in JSON and combines it with a new array of JSON strings.. foo and. Bar is the key that needs to get the value in the original JSON string.
Note that the generated JSON string content order is positive, which is generated in the example: ["Foov", "Barv"]