I an trying to extract one specific value from a json string. The string looks like this:
{"801":{"170":{"100":"25.12.17 23:38:30","101":0,"102":0,"103":0,"104":0,"105":400,"106":200,"107":51100,"108":5329700,"109":17596300,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":5500}}}
I am trying to put the value behind "105"(400 in this example) in a variable. I have tried the following:
wget -qO- --post-data='{"801":{"170":null}}' http://192.168.1.11/getjp \
|sed -e 's/[{},]/\n/g' \
| stroom=$ awk -F : '
{if($1=="\"105\"") {print $2}};
This prints the value I want (400) but the variable is empty.
What is the best way to extract that exact value from the JSON string?