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

JQ:How to remove items from json array with conditions?

$
0
0

I have the following few json array objects that Id like to filter using a single jq command.

{"Sid": "bla1","Effect": "Allow","Principal": {"AWS": "*"    },"Action": "blabla","Resource": "blablablabla","Condition": {"ArnLike": {"aws:bla": ["blablablablablabla*","blablablablabla*","blablablabla:*"        ]      }    }  }

How can i remove item "blablablablablabla:*" from "Condition->ArnLike->aws:bla" if "Sid" == "bla1"

expected result like below

{"Sid": "bla1","Effect": "Allow","Principal": {"AWS": "*"    },"Action": "blabla","Resource": "blablablabla","Condition": {"ArnLike": {"aws:bla": ["blablablablabla*","blablablabla:*"        ]      }    }  }

best regards


Viewing all articles
Browse latest Browse all 527

Trending Articles



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