RTLD may automatically deliver compressed log data to a Google Cloud Storage bucket by submitting HTTPS
PUT
requests to it. Each request adds an object to a Cloud Storage bucket. This object contains a compressed JSON or CSV document that uniquely identifies a set of log data and describes one or more log entries.Key information:
-
The set of available log fields varies by RTLD module: RTLD CDN | RTLD WAF | RTLD Rate Limiting | RTLD Bot | RTLD Cloud Functions
-
RTLD applies gzip compression to log data. Google Cloud Storage stores compressed log data as an object with a
gz
file extension. -
Configure your Google Cloud Storage bucket as follows:
-
The recommended configuration is to set the Access control option to
Uniform
. -
Set the Encryption option to a Google-managed encryption key.
-
Authorize RTLD to upload content by adding the following user with the Storage Object Creator role:
real-time-log-delivery@durable-firefly-334516.iam.gserviceaccount.com
-
-
You may define a prefix when setting up a log delivery profile. This prefix defines a virtual log file storage location and/or a prefix that will be pre-pended to the name of each object added to your bucket. Use the following guidelines when setting this prefix:
- A prefix should not start with a forward slash.
- A forward slash within the specified prefix is interpreted as a delimiter for a virtual directory.
- A trailing forward slash means that the specified value only defines a virtual directory path within your bucket where logs will be stored. If the specified value ends in a character other than a forward slash, then the characters specified after the forward slash will be prepended to the file name for each log file uploaded to your destination.
Sample prefix:logs/CDN/siteA_
The above prefix will store log files in the following virtual directory:/logs/CDN
The file name for each log file uploaded to your destination will start withsiteA_
.Sample log file name:siteA_wpc_0001_123_20220111_50550000F98AB95B_1.json
To set up Google Cloud Storage log delivery
-
Create or identify a Google Cloud Storage bucket to which log data will be posted.
-
Add the following user to the bucket and assign it the Storage Object Creator role:
real-time-log-delivery@durable-firefly-334516.iam.gserviceaccount.com
-
Optional. Set up Google Cloud to process the log data that will be posted to it.Example:Load logs into BigQuery and then leverage BigQuery functionality through the BigQuery Browser Tool.
-
Upon completing the above steps, you should create a log delivery profile for Google Cloud Storage.
To set up a log delivery profile
-
From the Real-Time Log Delivery page, click + New Log Delivery Profile and then select the desired type of log field.
-
Open the desired property.
- Select either your private space or a team space.
- Click on the desired property.
-
From the left pane, click on the desired environment.
-
From the left pane, click Realtime Log Delivery.
-
Click + New Log Delivery Profile and then select either CDN, WAF, Rate Limiting, Bot, or Cloud Functions.
-
-
From the Profile Name option, assign a name to this log delivery profile.
-
From the Log Delivery Method option, select
Google Cloud Storage
. -
Define how RTLD will communicate with Google Cloud Storage.
-
Set the Bucket option to the name of the Google Cloud Storage bucket to which log data will be posted.
-
Optional. Set the Prefix option to the desired prefix that defines a virtual log file storage location and/or a prefix that will be added to each object added to your bucket.
-
-
From the Log Format option, select whether to format log data using our standard JSON format, as a JSON array, as JSON lines, or as a CSV (RTLD CDN only).Learn more about these formats: RTLD CDN | RTLD WAF | RTLD Rate Limiting | RTLD Bot | RTLD Cloud Functions
-
From the Downsample the Logs option, determine whether to reduce the amount of log data that will be delivered. For example, you may choose to only deliver 1% of your log data.
-
All Log Data: Verify that the Downsample the Logs option is cleared.
-
Downsampled Log Data: Downsample logs to 0.1%, 1%, 25%, 50%, or 75% of total log data by marking the Downsample the Logs option and then selecting the desired rate from the Downsampling Rate option.Use this capability to reduce the amount of data that needs to be processed or stored within your web server(s).RTLD CDN Only: Downsampling log data also reduces usage charges for this service.
-
-
Determine whether log data will be filtered.
-
By default, all log fields are enabled on a new log delivery profile. From within the Fields section, clear each field for which log data should not be reported.
-
Log fields are categorized. You may add or remove individual fields by expanding a category and then marking or clearing specific log fields. Alternatively, add or remove all of the log fields associated with a category by marking or clearing the desired category.
-
RTLD CDN Only: You may also log request headers, response headers, and cookies.
-
View log field definitions: RTLD CDN | RTLD WAF | RTLD Rate Limiting | RTLD Bot | RTLD Cloud Functions
-
-
Click Create Log Delivery Profile.