An operations team needs to enable network traffic telemetry on an existing VPC subnet named `prod-analytics-subnet` in the `us-east1` region. They must activate VPC Flow Logs, set the log aggregation interval to 10 seconds, and adjust the sampling rate to (). Which two `gcloud` flags or command invocations must the administrator execute to complete this network management task? (Select TWO answers.)
- Execute `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --enable-flow-logs`Answer
- Execute `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --logging-aggregation-interval=interval-10-sec --logging-flow-sampling=0.5`Answer
- CExecute `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --enable-vpc-audit-logs`
- DInstall the Cloud Logging legacy agent on all Compute Engine instances in the subnet to capture subnet-level packet headers
Answer
To manage and enable VPC Flow Logs on an existing subnet with specific aggregation and sampling parameters, run `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --enable-flow-logs` to turn on logging, and `gcloud compute networks subnets update prod-analytics-subnet --region=us-east1 --logging-aggregation-interval=interval-10-sec --logging-flow-sampling=0.5` to configure the sampling rate and aggregation interval.
VPC Flow Logs are enabled and configured on a subnet level using the `gcloud compute networks subnets update` command. Passing `--enable-flow-logs` activates the feature on the subnet, while `--logging-aggregation-interval=interval-10-sec` and `--logging-flow-sampling=0.5` set the aggregation window and 50% sample rate respectively.
Step-by-Step Solution
Key Concept
VPC Flow Logs Configuration via gcloud CLI