This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| virtualization:cloud:aws:jq [2022/02/25 12:17] – jotasandoku | virtualization:cloud:aws:jq [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Excellent examples of jq filters : [[https:// | + | * Simple introduction [[https:// |
| + | * Medium introduction [[https:// | ||
| + | * Excellent/ | ||
| jq . # the dots means ' | jq . # the dots means ' | ||
| + | For __Docker__: | ||
| + | networks: | ||
| + | aws ec2 describe-subnets | jq .[] | jq .[].Ipv6CidrBlockAssociationSet | jq .[].Ipv6CidrBlockState | ||
| aws ec2 describe-regions | aws ec2 describe-regions | ||
| aws ec2 describe-vpcs | jq -r " | aws ec2 describe-vpcs | jq -r " | ||
| aws ec2 describe-vpcs | jq -r '.Vpcs | length' | aws ec2 describe-vpcs | jq -r '.Vpcs | length' | ||
| aws ec2 describe-vpcs --region eu-west-1 | jq -r '.Vpcs | length' | aws ec2 describe-vpcs --region eu-west-1 | jq -r '.Vpcs | length' | ||
| - | | + | |
| + | cat response.json| jq .data | jq -r ' | ||
| + | cat response.json| jq '.data | .[] | .attributes' | ||
| + | cat response.json| jq '.data | .[] | .attributes.subobject.dns_scoping' | ||
| + | |||
| + | PRETTY TABLE FORMAT:\\ | ||
| + | |||
| + | aws ec2 describe-instances \ | ||
| + | --query ' | ||
| + | --filters " | ||
| + | --output table | ||
| + | |||
| + | {{: | ||
| + | |||
| Lists the public IPs (querying the OCI DNS): | Lists the public IPs (querying the OCI DNS): | ||
| Line 32: | Line 51: | ||
| \\ | \\ | ||
| oci network nsg list --region us-phoenix-1 --compartment-id ocid1.compartment.oc1..aaaaaaaax5zpuw6ggeudpiqueidy5xlqentk2ngs7p6445an34mgwlrpbccq | jq -r ' | oci network nsg list --region us-phoenix-1 --compartment-id ocid1.compartment.oc1..aaaaaaaax5zpuw6ggeudpiqueidy5xlqentk2ngs7p6445an34mgwlrpbccq | jq -r ' | ||
| - | | + | |
| \\ | \\ | ||
| Formatted output with my own labels [[https:// | Formatted output with my own labels [[https:// | ||
| Line 44: | Line 63: | ||
| | | ||
| docker network inspect bg0 | jq -f myfilterabove | docker network inspect bg0 | jq -f myfilterabove | ||
| + | |||
| + | |||
| + | * '' | ||