NSQ Logs
Introductionâ
Collect log information from the request gateway and output it to NSQ, making it convenient for users to perform secondary operations such as log analysis.
Featuresâ
Ability to output log content generated during program execution to a specified NSQ Topic.
- Supports configuring multiple
NSQDrequest addresses - Supports different log output format types
- Supports custom log formatting configuration
Operation Demonstrationâ
Create NSQ Log Configurationâ
- Click on
Operations & Integration->NSQ Logs, then clickAdd NSQ Log.

- Fill in the NSQ log configuration and click
Confirmafter completion.

Configuration Description:
| Field Name | Description |
|---|---|
| NSQD Address List | The list of addresses where NSQD provides TCP services, supporting multiple addresses |
| Topic | Information about the NSQD Topic |
| Authentication Secret | Key information for NSQD access authentication |
| Output Format | Supported output log content formats, such as single-line and JSON format |
| Formatting Configuration | Output format template, configuration tutorial available here |
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"
]
}
Deploymentâ
- Click the
Deploybutton next to the configuration you wish to deploy.
