I'm trying to filter a plain list I get from the Azure CLI, and am struggling to construct a query that filters the list properly. An example which encapsulates what I'm trying to accomplish would be trying to filter the list [1, 2, 3, 4, 5]
and attempting to get all values greater than 2.
Using jq, I can do this like so: echo "[1, 2, 3, 4, 5]" | jq "map(select(. > 2))"
giving [3, 4, 5 ]
. The trouble comes from not being able to indicate the "current element" in JMESPath as far as I can tell, without having a particular key to refer to.
How would I go about filtering a simple list like this using a JMESPath query?