I have this yml file, How do i retrieve only the values under backends with bash? I know there's sed, grep and awk. I do not know what the best way to retrieve the data
affinityCookieTtlSec: 0
backends:
- balancingMode: UTILIZATION
capacityScaler: 0.0
group: https://www.googleapis.com/compute/
maxUtilization: 0.8
- balancingMode: UTILIZATION
capacityScaler: 1.0
group: https://www.googleapis.com/compute/
maxUtilization: 0.8
connectionDraining:
drainingTimeoutSec: 300
creationTimestamp: '2021-09-08'
description: ''
enableCDN: false
healthChecks:
- https://www.googleapis.com/compute/
kind: compute#backendService
loadBalancingScheme: EXTERNAL
logConfig:
enable: false
name: backend
port: 80
portName: portname
protocol: HTTP
selfLink: https://www.googleapis.com/compute/
sessionAffinity: NONE
timeoutSec: 30
Expected output
- balancingMode: UTILIZATION
capacityScaler: 0.0
group: https://www.googleapis.com/compute/
maxUtilization: 0.8
- balancingMode: UTILIZATION
capacityScaler: 1.0
group: https://www.googleapis.com/compute/
maxUtilization: 0.8