Enabling Flow Logs
Enable VCN Flow Logs for subnets, instances, load balancers, or network load balancers.
Before you can create a flow log, you must first create a log group and a capture filter.
Use the oci logging log create command and required parameters to create a flow log in a log group:
oci logging log create --display-name display_name --log-group-id log_group_OCID --log-type SERVICE --is-enabled true --profile profile_name --configuration file://create_log.json [OPTIONS]
In this example, the flow log configuration information is contained in the specified filecreate_log.json
. For example:{ "compartment-id": "compartment_OCID", "source": { "resource": "resource_OCID", "service": "flowlogs", "source-type": "OCISERVICE", "category": "subnet", "parameters": { "capture_filter":"capture_filter_OCID" } } }
For a complete list of parameters and variable options for CLI commands, see the CLI Command Reference.
Before you can create a flow log, you must first create a log group and a capture filter.
Run the CreateLog operation to create a flow log in a log group. For example:POST /api_version/logGroups/log_group_OCID/logs <authorization and other headers> {"displayName":"display_name", "logType":"SERVICE", "isEnabled":true, "configuration": {"source": {"sourceType":"OCISERVICE", "service":"flowlogs", "resource":"resource_OCID", "category":"subnet", "parameters": {"capture_filter":"capture_filter_OCID", "enablementPointType":"Subnet"} } } }