Skip to main content
Version: 1.2-beta

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 NSQD request addresses
  • Supports different log output format types
  • Supports custom log formatting configuration

Operation Demonstration

Create NSQ Log Configuration

  1. Click on Operations & Integration -> NSQ Logs, then click Add NSQ Log.

  1. Fill in the NSQ log configuration and click Confirm after completion.

Configuration Description:

Field NameDescription
NSQD Address ListThe list of addresses where NSQD provides TCP services, supporting multiple addresses
TopicInformation about the NSQD Topic
Authentication SecretKey information for NSQD access authentication
Output FormatSupported output log content formats, such as single-line and JSON format
Formatting ConfigurationOutput 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

  1. Click the Deploy button next to the configuration you wish to deploy.