Custom Log Push Fields
If you need to push certain field values in HTTP request headers, HTTP response headers, or Cookies, you can precisely record such information in logs through the Custom Log Field feature.
Note:
The Custom Log Field feature is applicable only to real-time logs.
Use Restrictions
In the same real-time log push task, custom field names must not be duplicate.
Up to 200 custom fields can be configured.
Field names are case-sensitive and must exactly match the original field names in HTTP actions.
Field names must contain 1-100 characters, beginning with a letter and ending with a letter or a digit. The middle part may contain letters, digits, and hyphens (-).
Currently, only Site Acceleration Logs support adding custom fields.
Example: Recording the Value of a Specified Response Header in Logs
Sample Scenario
In some business scenarios, understanding the size of the response body is crucial for monitoring the network traffic and optimizing the performance. For this purpose, custom log fields can be configured to record the value of the
Content-Length
header for each response.Directions
1. Log in to the EdgeOne console and click Site List in the left sidebar. Then click on the site to be configured in the site list, to enter the site details page.
2. On the site details page, click Log Service > Real-time Logs.
3. On the real-time logs page, click Create Push Task.
4. On the log source selection page, enter a task name, select a log type, service area, and domain name/L4 proxy instance requiring log push, and click Next.
5. On the push content definition page, click Add Custom Field.
5.1 Select Response header as the field type.
5.2 Enter
Content-Length
as the field name.5.3 Click Save.
6. After configuring the destination, click Push, confirm the related cost tips in the pop-up window, and click Confirm Creation to save the configuration.
References
If you wish to understand the meanings of various HTTP request and response headers for deciding whether to record them in logs, refer to HTTP Standard Header Explanation.