tencent cloud

Cloud Log Service

Logstash Log Upload

PDF
Focus Mode
Font Size
Last updated: 2025-12-03 11:22:42

Overview

Logs collected from Logstash can be uploaded to Cloud Log Service (CLS) through the following two Logstash extensions:
This document describes how to upload logs to CLS using these two Logstash output extensions.

Log Upload via the CLS Output Extension

Note:
Ensure that the account associated with the cloud API key has appropriate minimum permissions for Logstash log upload.
1. Run the following command to install the Logstash CLS output extension.
logstash-plugin install logstash-output-cls
2. Run the following command to run the Logstash CLS output extension.
logstash -f logstash-sample.conf
3. Configure the Logstash configuration file example/fluent.conf.
input {
}

## If you need to specify a time field in the log as the timestamp, you can configure the following time parsing settings:
filter {
date {
match => ["produce_log_time","yyyy-MM-dd HH:mm:ss.SSS"]
target => "@timestamp"
}
}

output {
cls{
endpoint => "[CLS data access domain name]"
topic_id => "[Log topic ID]"
access_key_id => ""
access_key_secret => ""
}
}

Parameter Description

Parameter Name
Type
Required
Default Value
Description
endpoint
string
Yes
-
Domain name of the region where the target log topic is located. See Available Regions.
Example:
Private network domain name of Guangzhou: ap-guangzhou.cls.tencentyun.com
Public network domain name of Guangzhou: ap-guangzhou.cls.tencentcs.com
topic_id
string
Yes
-
ID of the log topic to which the log will be uploaded.
source
string
No
IP address of the local NIC
IP address of the source from which the log originates.
access_key_id
string
Yes
-
Part of the cloud API key. SecretId is used to identify the API caller's identity.
access_key_secret
string
Yes
-
Part of the cloud API key. SecretKey is the key used to encrypt the signature string and verify the signature string on the server side.
max_buffer_items
int
No
4000
Logs are uploaded by batch. This parameter controls the maximum number of log entries that can be included in one batch.
max_buffer_bytes
int
No
2097152
Logs are uploaded by batch. This parameter controls the maximum total size of each batch in bytes.
max_buffer_seconds
int
No
3
Logs are uploaded by batch. This parameter controls the maximum dwell time from creation to sending for each batch.
total_size_in_bytes
int
No
104857600
Maximum size of logs that the instance can cache, in bytes.
max_send_retry
int
No
10
Maximum number of retries when log upload fails.
send_retry_interval
int
No
200
Time interval between retries when log upload fails.
to_json
boolean
No
true
Whether to perform JSON parsing on collected logs.
time_key
string
No
@timestamp
Key name of the source field for log timestamp.

Log Upload via the Kafka Output Extension



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback