Skip to main content
  1. Technologies/

jq

·62 words·1 min· ·
Technologies notes - This article is part of a series.
Part 7: This Article

Personal jq expression language reference

  • create custom output with string interpolation from array of objects
.[] | "\(.var1) \(.var2)"
  • count number of elements in array
.[] | length
  • loop an array and run command for each element
jq -c '.[]' input.json | while read i; do
done
  • filter an array of object based on a parameter
jq '.[] | select(.param_name) | "\(.param_to_print)"'
Matteo Longhi
Author
Matteo Longhi
I’m a software engineer with a passion for Music, food, dogs, videogames and open source software, i’m currently working as a devops engineer
Technologies notes - This article is part of a series.
Part 7: This Article