Kafka Log
Collect the log information from the request gateway and output it to Kafka
, making it convenient for users to perform secondary operations, such as log analysis.
Features
Enables the output of log content generated during the program's operation to a specified Kafka cluster queue.
Operation Demonstration
Create a New Kafka Log Configuration
- Click
Operations and Integration
->Kafka Log
, and then clickAdd Kafka Log
.
- Fill in the Kafka log configuration, and click save after completing.
Configuration Description:
Field Name | Description |
---|---|
Version | Kafka version |
Server Address | Kafka service address, multiple addresses separated by commas |
Topic | Kafka service Topic information |
Partition Type | Method of choosing partition, default is hash. When choosing hash, if partition_key is empty, random selection is used |
Partition | When Partition Type is manual, this specifies the partition number |
Partition Key | When Partition Type is hash, this specifies the hash value |
Request Timeout | Timeout duration, in seconds |
Output Format | The format of output log content, supports single-line, JSON format output |
Formatting Configuration | Output format template, for configuration tutorial click here to jump |
Example Formatting Configuration
{
"fields": [
"$time_iso8601",
"$request_id",
"@request",
"@proxy",
"@response",
"@status_code",
"@time"
],
"request": [
"$request_method",
"$scheme",
"$request_uri",
"$host",
"$header",
"$remote_addr"
],
"proxy": [
"$proxy_method",
"$proxy_scheme",
"$proxy_uri",
"$proxy_host",
"$proxy_header",
"$proxy_addr"
],
"response": [
"$response_headers"
],
"status_code": [
"$status",
"$proxy_status"
],
"time": [
"$request_time",
"$response_time"
]
}
Go Live
- Click the
Go Live
button beside the configuration to be launched.