4 ms·
Besides's this projects cli, jp (https://github.com/jmespath/jp https://github.com/jmespath/jp), I see jl (https://github.com/chrisdone/jl https://github.com/ch
by johnhenry 9y ago
Besides's this projects cli, jp (https://github.com/jmespath/jp https://github.com/jmespath/jp), I see jl (https://github.com/chrisdone/jl https://github.com/chrisdone/jl) and jq (https://github.com/stedolan/jq/ https://github.com/stedolan/jq/) in the comments. I wonder if anyone has had experience with all three (or even just one) and can comment on their experiences?
- zephharben 9y agoI've used jq and jp/JMESPATH quite a bit. I love jq, and use it more often than JMESPATH. However, recently I've noticed that I arrive at "the solution" I need more quickly with JMESPATH. In retrospect, JMESPATH's documentation and examples have been more useful for me than jq's (docs/examples).
- cryptonector 9y agojq has a community wiki. We really should rewrite the docs at some point and/or add lots of examples, as the language has grown quite a lot.
- zero_intp 9y agoI use jq on simple projects and to prototype. It is lightweight, fast, and usually consistent in operation.
- vthriller 9y agoI only have used jq, but I noticed that even AWS CLI docs [0] (already mentioned in the comments a couple of times) suggest to use jq for "more advanced features that may not be possible with --query". [0] https://docs.aws.amazon.com/cli/latest/userguide/controlling-output.html#controlling-output-filter https://docs.aws.amazon.com/cli/latest/userguide/controlling...
- gregmac 9y agoI've been using jq quite a bit with AWS CLI inside various bash scripts. It allows manipulation and filtering the native api doesn't, which makes it pretty straight forward to get certain values - such as specific tags on the current instance (converted to key-value form, or to turn into bash variables), a list of other systems in the current auto scaling group, etc. I've also started using it just to get colorized/formatted output from curl or a local json file. cat file.json | jq
- billsmithaustin 9y agoI use jq frequently. It covers most of what I want to do.
- ak217 9y agojq is by far the best developed and has the most intuitive syntax, but it doesn't have a formal spec for its language. I have been maintaining https://github.com/kislyuk/yq https://github.com/kislyuk/yq, which wraps jq with a transcoder for YAML and XML.
- cryptonector 9y agoIs there demand for a formal spec for jq? Would that lead to additional implementations? Serious question.
- llimllib 9y agoI would love to have a jq lib in every lang, which would probably require a spec
- cryptonector 9y agoThat's fair.
- fiatjaf 9y agoApparently JMESPath is a better JSONPath/dot-notation alternative for querying JSON, while jq and jl are full-featured fully functional programming languages that happen to use JSON as their underlying data type. I had never heard of jl before, but I've recently compiled an "awesome" collection of jq tools, libraries and use-cases at https://github.com/fiatjaf/awesome-jq https://github.com/fiatjaf/awesome-jq that may be worth checking out.
- wryun 9y agojq has a more polished CLI and can do 'everything'. jmespath is more limited, but is well specified and easier to fit in your head. It's also much more appropriate for using as a library from other projects, since it has clean implementations in many languages. It's also an advantage in this case that it can't do everything, since you can more realistically provide untrusted user input. jmespath's default (Go) CLI isn't as fully featured as jq, unfortunately.