To utilize jq with streams to parse information about Amazon's RDS instances, you can use the following method:
aws rds describe-db-instances --output json --query "DBInstances[*]" --stream
aws rds describe-db-instances --output json --query "DBInstances[*]" --stream | jq -c '{id: .DBInstanceIdentifier, name: .DBName, status: .DBInstanceStatus}'
This command uses the -c option to output each result as a single line of JSON for easier parsing and manipulation.
aws rds describe-db-instances --output json --query "DBInstances[*]" --stream | jq -r '.[] | select(.DBInstanceStatus == "available") | .DBInstanceIdentifier'
This command uses the -r option to output the result as raw text, and the select filter to only include instances with a status of "available".
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-01-06 11:00:00 +0000
Seen: 9 times
Last updated: Dec 18 '21
What are the steps to troubleshoot the reason for the failures in AWS ALB health checks?
How can I use one POST request to update the statuses of multiple instances in Razor ASP.NET?
How can two GCP instances with static IPs be created using Terraform?
What is the meaning of two databases on a Postgres server?
How can ec2 instances be created in every availability zone using Terraform?
What is the process of creating instances of interfaces called?
How can FormSet changes be saved when related models are involved?
What is the method for altering the color of the input text in a TextFormField in Flutter?