Try to search your question here, if you can't find : Ask Any Question Now ?

Extract nested JSON data in Python

HomeCategory: stackoverflowExtract nested JSON data in Python
Avatarjulie asked 1 week ago

I am trying to get a value from a data JSON. I have successfully traversed deep into the JSON data and almost have what I need!

Running this command in Python :
autoscaling_name = response['Reservations'][0]['Instances'][0]['Tags']

Gives me this :

'Tags': [{'Key': 'Name', 'Value': 'Trove-Dev-Inst : App WebServer'}, {'Key': 'aws:autoscaling:groupName', 'Value': 'CodeDeploy_Ernie-dev-Autoscaling-Deploy_d-4WTRTRTRT'}, {'Key': 'CodeDeployProvisioningDeploymentId', 'Value': 'd-4WTRTRTRT'}, {'Key': 'Environment', 'Value': 'ernie-dev'}]

I only want to get the value “CodeDeploy_Ernie-dev-Autoscaling-Deploy_d-4WTRTRTRT”. This is from the key “aws:autoscaling:groupName”

How can I further my command to only return the value “CodeDeploy_Ernie-dev-Autoscaling-Deploy_d-4WTRTRTRT”?

1 Answers
Best Answer
AvatarArben answered 1 week ago
Your Answer

13 + 19 =

Popular Tags

WP Facebook Auto Publish Powered By :