Q: 6
You are troubleshooting a network connectivity issue between a compute instance in a private
subnet within your VCN and a service on the public internet using Cloud Shell. You suspect a problem
with the network security group (NSG) rules associated with the instance's VNIC. Which Cloud Shell
command and appropriate tool combination allows you to directly inspect the NSG configuration
impacting the VNIC?
Options
Discussion
OwenM, agree with you that jq is more reliable when parsing JSON from the CLI. D looks tempting if you're used to quick shell scripting, but OCI's responses can get messy. Pretty sure B is the safest choice for structured output here, but open to other tricks if someone has a real-world edge case.
Option B is the way I'd go. Parsing with jq handles structured OCI JSON much better than awk, so it's less likely to break if the format changes. D looks close but falls for that classic brittle parsing trap.
B tbh. Awk parsing like D feels too brittle, jq is safer for JSON. Trap here is thinking D works every time.
Feels like B. jq is just way better for handling the nested JSON that OCI CLI spits out, especially when you're tracing VNICs to their NSGs. D looks clever but awk gets messy if the JSON structure changes at all. Anyone have luck making D work reliably?
Its B for sure. Using jq is more stable with OCI CLI JSON than awk in D, so you actually get the right NSG attached to the VNIC. Happy if someone can show a working D though.
Maybe D. The awk+xargs combo seems like it could grab the NSG info if you know the VNIC, at least in some scripts I've seen in exam prep guides. Haven't seen this exact string in labs but sounds workable? Check official Oracle CLI docs to be sure.
Be respectful. No spam.