You are here

Sample 'jq' to extract '.uptime' and '.loads'

1 post / 0 new
nc8q
nc8q's picture
Sample 'jq' to extract '.uptime' and '.loads'
gelmce@HP-Laptop:~/Downloads$ curl -s 'http://nc8q-r2h7/cgi-bin/sysinfo.json' | jq '.loads'
null
gelmce@HP-Laptop:~/Downloads$ curl -s 'http://nc8q-r2h7/cgi-bin/sysinfo.json' | jq '.uptime'
null
gelmce@HP-Laptop:~/Downloads$ curl -s 'http://nc8q-r2h7/cgi-bin/sysinfo.json' | jq '.lat'
"39.89966"
gelmce@HP-Laptop:~/Downloads$ curl -s 'http://nc8q-r2h7/cgi-bin/sysinfo.json' | jq '.lon'
"-84.31904"
gelmce@HP-Laptop:~/Downloads$

I want to store the uptime and load values to a local file.

How do I use 'jq' to obtain load and uptime values?

73, Chuck
 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer