Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 521

jq parse json with key which has special character DOT (.)

$
0
0

I have a json

{ "fundingMoved": {"com.mytest.map": {"map": {"java.util.HashMap": {"AGREEMENT_OWNING_ORG": "ABC 22","WAREHOUSE": "XYZ 6"            }        }    }  }}

I am trying to write a script to see if AGREEMENT_OWNING_ORG contains ABC and WAREHOUSE contains XYZ

My script so far

grep . jk_raw | jq -r ".fundingMoved."com.mytest.map""

This is returning null but

grep . jk_raw | jq -r ".fundingMoved

This returns result .

Issue . Due to the Dot (.) in key it is not returning the response

I checked this related post How to use jq when the variable has reserved characters?

This is suggesting to use double quote. I tried that but still response is null.

I tried to escape character . as . that doesnt help either

How to extract value from this


Viewing all articles
Browse latest Browse all 521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>