title: Extract values from a Json in bash
body: <p>I am trying my hand on shell scripting and was trying to extract values from a Json and store it into a variable to use it later. But I am unable to do so, have tried follow up lots of links and suggestion, probably I am doing something wrong.
  Basically I am using curl to hit an url and from the response I am trying to extract the value of a <strong>status</strong> field .
  I am trying the following lines, </p>
  
  <p><code>result=$(curl "http://localhost:9200/domains" | grep "status" | awk '{print $1 }')
  echo "the result is" $result</code></p>
  
  <p>The curl command will fetch something like </p>
  
  <pre><code>{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"domains","index_uuid":"_na_","index":"domains"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"domains","index_uuid":"_na_","index":"domains"},"status":404}
  </code></pre>
  
  <p>Any help in this regard is really appreciated. I know we can do it in jq or perl but I am looking for a solution using grep, sed or awk.</p>
  
  <p>Thanks 
  Ashit </p>