Networknet archive Blog

Tools: Parse and filter JSON output with jc and jq

Originally published

I am exploring the IPv6 stack from the shell. On my Debian jump box in AWS, I ran a ping, converted the output to JSON with jc and filtered it with jq. I tested against delta.nl to extract the destination IP address and average round-trip time.

Bash1 line
1
ping -c 4 delta.nl | jc --ping -p | jq '.destination_ip,.round_trip_ms_avg'
Code2 lines
1
2
"2606:4700:4400::ac40:9425"
1.349

My next step is to put this into a Bash script and make a POST request to InfluxDB. After that, I want to create a dashboard in Grafana.

References