1 | initial version |
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".