Jq: Difference between revisions

From Omnia
Jump to navigation Jump to search
(Created page with "== jq == jq https://jqlang.github.io/jq/ jq is a lightweight and flexible command-line JSON processor. jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text. == pretty print json == echo '{"foo": "lorem", "bar": "ipsum"}' | jq == tutorial == jq tutorial https://jqlang.github.io/jq/tutorial/")
 
 
Line 16: Line 16:
  jq tutorial
  jq tutorial
  https://jqlang.github.io/jq/tutorial/
  https://jqlang.github.io/jq/tutorial/
== jq change case ==
.key|ascii_uppercase
.key|ascii_downcase
Examples:
.results[]|select ((.key|ascii_downcase)=="answer")|.value
.results[]|select ((.key|ascii_downcase)=="answer")|{"answer":.value}
ref: https://discuss.rapid7.com/t/reformatting-data-with-the-jq-plugin/4551
== cheat sheet ==
jq cheat sheet
https://developer.zendesk.com/documentation/integration-services/developer-guide/jq-cheat-sheet/
== notes ==
== keywords ==

Latest revision as of 20:23, 28 July 2024

jq

jq
https://jqlang.github.io/jq/
jq is a lightweight and flexible command-line JSON processor.
jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.

pretty print json

echo '{"foo": "lorem", "bar": "ipsum"}' | jq

tutorial

jq tutorial
https://jqlang.github.io/jq/tutorial/

jq change case

.key|ascii_uppercase
.key|ascii_downcase

Examples:

.results[]|select ((.key|ascii_downcase)=="answer")|.value
.results[]|select ((.key|ascii_downcase)=="answer")|{"answer":.value}

ref: https://discuss.rapid7.com/t/reformatting-data-with-the-jq-plugin/4551

cheat sheet

jq cheat sheet
https://developer.zendesk.com/documentation/integration-services/developer-guide/jq-cheat-sheet/

notes

keywords