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

jq equivalent in python

$
0
0
cat * | jq '.cis[].properties.cloud_vm_display_name' | grep -v null

"azuXXXXX""azuXXXXX""azuXXXXXX""azuXXXXXX"

Need to extract cloud VM name from multiple json files where the array number is different in every file.

a = data1['cis'][0]['properties']['TenantsUses'][0]print(a)b = data1['cis'][]['properties']['cloud_vm_display_name']

File "", line 17b = data1['cis'][]['properties']['cloud_vm_display_name']^SyntaxError: invalid syntax

print(a) is providing correct output but the value [] for variable b is not known, need your support in finding the output.

To find the VM name from various json files which are generated for different servers.


Viewing all articles
Browse latest Browse all 524

Trending Articles



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