Parameter | Type | Example value | Description |
Keys | Array of String | [ "time", "", "level", "msg" ] | List of log field names (Keys).
|
Quote | String | " | Quotation mark Content enclosed by quotation marks will be parsed as a single field, not separated. Valid only when LogType is set to delimiter_log. |
TimeKey | String | request_time | Name of the log timestamp field. If you use the specified time field in the log as the log timestamp, you need to configure both TimeKey and TimeFormat. TimeKey and TimeFormat must be configured as a pair. |
LogRegex | String | [(\d+-\d+-\w+:\d+:\d+,\d+)]\s[(\w+)]\s(.*) | The regular expression that matches the entire log.
|
TimeZone | String | GMT+08:00 | Time zone. Supports host time zone (default) and custom time zone. Custom time zone supports both GMT and UTC.
|
Delimiter | String | # | Log separator. Valid only when LogType is delimiter_log. |
BeginRegex | String | [(\d+-\d+-\w+:\d+:\d+,\d+)]\s[(\w+)]\s(.*) | The regular expression required to match the first line of the log.
|
TimeFormat | String | %Y-%m-%dT%H:%M:%S,%f | Parsing format for the time field. If you use a specified time field in the log as the log timestamp, you need to set both TimeKey and TimeFormat.
|
LogTemplate | { "Type": "Nginx", "Format": "format main '$remote_addr - $remote_user [$time_local] \"$request\" $request_time $request_length $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\"';" } | Automate log field extraction according to the specified log template. | |
UnMatchLogKey | String | LogParseFailed | When uploading logs with parsing failure, set the key name for those logs. UnMatchUpLoadSwitch=true and UnMatchLogKey must be used together. |
FilterKeyRegex | / | List of filter rules.
| |
TimeExtractRegex | String | [0-9]{0,2}\/[0-9a-zA-Z]+\/[0-9:,]+ | Regular expression for extracting time, used to extract the time value from the TimeKey field and parse it as the corresponding collection time. |
UnMatchUpLoadSwitch | Boolean | true | Upload failed parsing logs. UnMatchUpLoadSwitch=true and UnMatchLogKey must be paired together.
|
EnableNanosecond | Boolean | true | Enable nanosecond precision time. When enabled, log time parsing will include and report time with nanosecond precision.
|
TimeSample | String | 2006-01-02T15:04:05Z07:00 | Time sample. Used to determine whether the specified time parsing format is correct. |
Parameter | Type | Example value | Description |
EnvTag | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | This button determines whether to set environment label as log tag and add it to raw log data. If enabled, TLS will add related container environment variable fields to the logs. If you set multiple key-value pairs, it means you add multiple fields. For example, set the Key to source and the Value to data_source. If the container includes the environment variable source=DC, a new field __tag__data_source__: DC will be added to the log. |
Stream | String | all | Collect information.
|
KubernetesRule | { "NamespaceNameRegex": ".*test.*", "WorkloadType": "Deployment", "WorkloadNameRegex": ".*test.*", "IncludePodLabelRegex": { "Key1": "Value1", "Key2": "Value2" }, "ExcludePodLabelRegex": { "Key1": "Value1", "Key2": "Value2" }, "PodNameRegex": ".*test.*", "LabelTag": { "Key1": "Value1", "Key2": "Value2" } } | Collection rules for Kubernetes containers. | |
ContainerNameRegex | String | .*test.* | Name of container to collect If the container name is not specified, all containers in the host group will be collected. Supports regular expression matching. For example, if the container name is set to ^(container-test)$, all containers named container-test will be collected. |
ExcludeContainerEnvRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | The container environment variable denylist specifies which containers are excluded from data collection. If the denylist is disabled, all containers will be collected. If you enable the container environment variable denylist, Key is required, while Value is optional.
|
IncludeContainerEnvRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | Specify which containers to collect by using the container environment variable allowlist. If the allowlist is not enabled, all containers will be collected. To enable the container environment variable allowlist, enter key-value pairs. Key is required; value is optional.
|
ExcludeContainerLabelRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | The container label denylist is used to specify which containers should not be collected. If the denylist is disabled, all containers are collected. If the container label denylist is enabled, the Key field is required and the Value field is optional.
|
IncludeContainerLabelRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | You can specify which containers to collect using container label allowlists. When the allowlist is not enabled, all containers will be collected. When enabling the container label allowlist, you need to fill in key-value pairs. Key is required; value is optional.
|
Parameter | Type | Example value | Description |
Fields | JSON Map | {"ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"} | Add constant fields to logs. Constant fields must follow these restrictions:
|
Plugin | {"processors":[{"json":{"field":"__content__","trim_keys":{"mode":"all","chars":"#"},"trim_values":{"mode":"all","chars":"#"},"allow_overwrite_keys":true,"allow_empty_values":true} | LogCollector plugin configuration. After enabling plugin configuration, you can add one or more LogCollector processor plugins to parse logs with complex or variable structures. | |
Advanced | { "CloseInactive": 10 } | LogCollector extended configuration. | |
RawLogKey | String | __raw__ | Original log field name. This only takes effect when EnableRawLog is set to true. RawLogKey defaults to __raw__, which means the original log data will be encapsulated in the __raw__ field and uploaded to TLS together with the parsed log data. |
TailFiles | Boolean | true | The collection policy determines whether LogCollector collects incremental logs or full logs. The default is false, which means collecting all logs.
|
HostnameKey | String | hostname | hostname field name. Set only when EnableHostname is true. |
EnableRawLog | Boolean | true | Upload original log.
|
ShardHashKey | { "HashKey": "3C" } | Rules for routing log shards.
| |
ParsePathRule | { "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log", "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log", "Keys": ["instance-id", "pod-name"] } | Parse rules for the collection path. After setting the rules, fields will be extracted from the collection path with the regular expressions defined in the rules and added to the log data as metadata. tip This parameter cannot be specified when collecting container standard output. | |
EnableHostname | Boolean | true | You can choose whether to upload the hostname field. By default, it is disabled.
|
HostGroupLabelKey | String | host_group_label | Field name used to store host group label information |
EnableHostGroupLabel | Boolean | true | You can choose whether to upload the Label information of the host group to TLS. By default, it is disabled.
|
TailSizeKb | Integer | 1024 | Backtracking threshold for incremental collection, measured in KiB. When the LogCollector uses incremental collection:
|
IgnoreOlder | Integer | 7 | Ignore log files not updated for the specified duration (in hours). |
MultiCollectsType | String | RuleID | You can collect log files multiple times.
|
Parameter | Type | Example value | Description |
LabelTag | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | This button determines whether to add Kubernetes Labels as log tags to the raw log data. If enabled, TLS will add Kubernetes Pod Label related fields to the logs. If you set multiple key-value pairs, multiple fields are added. For example, set the key to source and the value to data_source. If the Pod has the label source=DC, TLS will add the field __tag__data_source__: DC to the log. |
PodNameRegex | String | .*test.* | Pod name specifies the container to collect. If you do not specify a Pod name, all containers will be collected. Pod name supports regular expressions. For example, set the Pod name to ^(http.*)$ to collect all containers under Pods whose names start with "http." |
WorkloadType | String | Deployment | Specify the container for collection based on workload type. Only one type can be selected. If no type is specified, containers of all types are collected. Supported workload types:
|
AnnotationTag | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | This button determines whether to set Kubernetes Annotation to log tags and add it into the raw log data. If enabled, TLS will add Kubernetes Pod annotation fields to the logs. If you set multiple key-value pairs, multiple fields are added. For example, if you set the key to sink and the value to data_sink, and the Pod includes the annotation sink=ck, a new field __tag__data_sink__: ck will be added to the log. |
WorkloadNameRegex | String | .*test.* | By configuring the workload name, you can specify the container to collect. If no workload name is specified, all containers are collected. Workload names support regular expression matching. For example, setting the workload name to ^(http.*)$ collects all containers under workloads that start with http. |
NamespaceNameRegex | String | .*test.* | Name of the Kubernetes namespace to be collected. If no Namespace is specified, all containers will be collected. Namespace names support regular expression matching. For example, setting the namespace name to ^(tcp|udp)$ means collecting all containers in the tcp and udp namespaces. |
ExcludePodLabelRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | Use the Pod Label denylist to specify which containers to exclude from collection. If not enabled, all containers will be collected. If you need to set a Pod Label denylist, the Key field is required, while the Value field is optional.
tip
|
IncludePodLabelRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | The Pod Label allowlist is used to specify the containers to be collected. If the Pod Label allowlist is not enabled, all containers will be collected. If you need to set the Pod label allowlist, the key field is required.
tip
|
EnableAllLabelTag | Boolean | true | This button determines whether to add all Kubernetes labels as log tags to the raw log data. When enabled, TLS will add all related Kubernetes Pod label fields to logs. For example, if a Pod contains the labels source=DC and destination=CS, TLS will add the fields __tag__source__: DC and __tag__destination__: CS to the logs. |
ExcludePodAnnotationRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | Pod Annotation denylist specifies containers that are excluded from collection. If you need to set a Pod Annotation denylist, the Key is required and the Value is optional.
By default, Value uses string matching. Containers only match if the value is exactly the same as the value of the Pod annotation. If the value starts with^and ends with$, it uses regular expression matching. For example, set the Key as "app" and set the Value as ^(test1|test2)$. This matches containers in Pods whose annotation contains app:test1 or app:test2. tip
|
IncludePodAnnotationRegex | JSON Map | { "Key1": "Value1", "Key2": "Value2" } | Pod annotation allowlist is used to specify the containers to be collected. If you need to set a Pod annotation allowlist, the Key field is required and the Value field is optional.
By default, Value uses string matching. Containers only match if the value is exactly the same as the value of the Pod annotation. If the value starts with^and ends with$, it uses regular expression matching. For example, set the Key as "app" and set the Value as ^(test1|test2)$, and then the containers in Pods whose annotation contains app:test1 or app:test2 will match. tip
|
Parameter | Type | Example value | Description |
CloseEOF | Boolean | true | After reading to the end of the log file, determine whether to release the handle of the log file. The default value is false. |
CloseRemoved | Boolean | true | Release the handle for the log file after it is removed. The default value is false. |
CloseRenamed | Boolean | true | Release the log file handle after it is renamed. The default value is false. |
CloseTimeout | Integer | 1800 | LogCollector monitors the maximum duration of log files. Measured in seconds, with a default of 0 seconds, meaning LogCollector does not limit the monitoring duration of log files. LogCollector starts timing when it begins monitoring a log file. After exceeding the specified duration, the log file handle is released immediately and monitoring ends, regardless of whether the file has been fully read. |
CloseInactive | Integer | 10 | Wait time for releasing the log file handle. If no new logs are written after the specified time, the log file handle is released. The unit is seconds, ranging from 1 to 300 seconds, with a default value of 60 seconds. |
NoLineTerminatorEOFMaxTime | Integer | 5 | Maximum wait time when LogCollector does not detect a newline character. Unit: seconds. Default is 5s. LogCollector starts timing when it begins reading the log file content. If no newline character is detected within the specified time, the logs in the buffer will be sent. If the file write interval is long, a complete log entry may be split into two parts and written separately. You can adjust this parameter based on your log write interval. |