dasel
kubectl-jq
Our great sponsors
dasel | kubectl-jq | |
---|---|---|
44 | 1 | |
4,864 | 12 | |
- | - | |
8.2 | 2.6 | |
7 days ago | 7 months ago | |
Go | Go | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dasel
- jq 1.7 Released
-
Dasel - jq for yaml json and toml
wget https://github.com/TomWright/dasel/releases/download/v2.1.2/dasel_linux_amd64 install -o root -g root -m 0755 dasel_linux_amd64 /usr/bin/dasel
-
Why a world needs an UNIX-style image collection manager?
https://github.com/TomWright/dasel handles JSON, TOML, YAML, XML and CSV
-
Tool to interact with CSV
dasel - Comparable to jq / yq, but supports JSON, YAML, TOML, XML and CSV with zero runtime dependencies.
-
Yq is a portable yq: command-line YAML, JSON, XML, CSV and properties processor
Another tool in this space is Dasel[1], which can handle querying/modifying JSON, YAML, TOML, XML and CSV files.
[1] https://github.com/TomWright/dasel
- Jc – JSONifies the output of many CLI tools
-
What are your coolest tools for one-liners ?
There also is dasel which combine jq, yq as well handling TOML, XML and CSV
- Run SQL on CSV, Parquet, JSON, Arrow, Unix Pipes and Google Sheet
-
What is the coolest Go open source projects you have seen?
dasel # most common human readable configs(json, yaml, xml...)
-
How to grep a specific field from curl output
I have recently switched to Dasel (https://github.com/TomWright/dasel ) due to its ability to work not only with JSON but also with other formats.
kubectl-jq
-
An Introduction to JQ
Big fan of JQ. I like it more than the traditional UNIX suite of text manipulation commands, because I get closer to "querying" rather than just filtering. It has really made me rethink where I want "interacting with a computer" to go in the future -- less typing commands, more querying stuff.
I have a few utilities involving JQ that I wrote.
For structured logs, I have jlog. Pipe JSON structured logs into it, and it pretty-prints the logs. For example, time zones are converted to your local time, if you choose; or you can make the timestamps relative to each other, or now. It includes jq so that you can select relevant log lines, delete spammy fields, join fields together, etc. Basically, every time you run it, you get the logs YOU want to look at. https://github.com/jrockway/json-logs. Not to oversell it, but this is one of the few pieces of software I've written that passes the toothbrush test -- I use it twice a day, every day. All the documentation is in --help; I should really paste that into the Github readme.
I am also a big fan of using JQ on Kubernetes objects. I know what I'm looking for, and it's often not in the default table view that kubectl prints. I integrated JQ into a kubectl extension, to save you "-o json | jq" and having to pick apart the v1.List that kubectl marshals objects into. https://github.com/jrockway/kubectl-jq. That one actually has documentation, but there is a fatal flaw -- it doesn't integrate with kubectl tab completion (limitation of k8s.io/cli-runtime), so it's not too good unless you already have a target in mind, or you're targeting everything of a particular resource type. This afternoon I wanted to see the image tag of every pod that wasn't terminated (some old Job runs exist in the namespace), and that's easy to do with JQ: `kubectl jq pods 'select(.status.containerStatuses[].state.terminated == null) | .spec.containers[].image'`. I have no idea how you'd do such a thing without JQ, probably just `kubectl describe pods | grep something` and do the filtering in your head. (The recipes in the kubectl-jq documentation are pretty useful. One time I had a Kubernetes secret that had a key set to a (base64-encoded) JSON file containing a base64-encoded piece of data I wanted. Easy to fix with jq; `.data.THING | @base64d | fromjson | .actualValue | @base64d`.
JQ is something I definitely can't live without. But I will admit to sometimes preprocessing the input with grep, `select(.key|test("regex"))` is awfully verbose compared to "grep regex" ;)
What are some alternatives?
jq - Command-line JSON processor [Moved to: https://github.com/jqlang/jq]
fx - Terminal JSON viewer & processor
yq - Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
jiq - jid on jq - interactive JSON query tool using jq expressions
miller - Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
json-logs - A tool to pretty-print JSON logs, like those from zap or logrus.
Go Metrics - Go port of Coda Hale's Metrics library
wsjq - Whitespace interpreter and debugger in jq
Moby - The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
gron - Make JSON greppable!
jq - Command-line JSON processor
howto - Documenting useful things, lest I forget, and sharing is caring