Reserved field | Description |
__path__ | Original log file directory and file name. |
__source__ | IP address of the server where the original log file is located. |
Configuration | Description |
Can be overwritten by new configuration | If there is an updated collection configuration, log files will not be collected according to the current configuration and will be collected based on the latest one. |
Permanent effect | Even if updated collection configurations exist, log files will continue to be collected based on the current configuration. Permanent effect applies only to LogCollector version 2.1.0 and later and may result in duplicate collection fees. For more details, refer to Collecting multiple copies of file logs or standard output. |
Configuration | Description |
Directory path | The specified directories that can be skipped during collection. Directory paths support exact matching and wildcard pattern matching.
|
File path | The specified files can be skipped during collection. You need to configure the file path and file name. File path supports both exact match and wildcard pattern match.
|
Configuration | Description |
Full |
|
Increment | Only newly added content within the file is collected. When new logs are written to log files within the monitor scope, it triggers LogCollector collection.
|
Parameters | Description |
Separator | It is the separator between different fields in log data. Select the correct separator according to the log format to ensure every field can be accurately extracted. TLS supports configuring various common separators, such as spaces and commas. If the separator used in your log data is not listed in the options, you can set the separator to custom and then specify the separator in custom separator. tip
|
Quotation mark | If a log field value contains separators, enclose the entire field value within the specified quote character in the log; otherwise, the content may be incorrectly split by the separator. After specifying the separator and quote character, any content wrapped by the quote character will be parsed by TLS as a complete field, regardless of whether it contains separators. For example, if a raw log is 20220511 debug "parse meet error" and the separator is set as space, then:
Supported quote characters include do not configure, single quote, double quotes, or custom. If you choose a custom character, you need to set a custom quote. tip
|
Log example | Enter a valid log example, and then click Extract value. |
Extract result | TLS parses logs based on log samples and the specified separator, and then extracts log fields. Assign different keys to different log fields tip
|
Configuration | Description |
Filter | Log field filtering rules. It can be enabled or disabled. Disabled by default. When enabled, you can configure filtering rules by using regular expressions. Only logs that fully match the regular expression will be collected and reported. This helps you filter log data that you need. For example, set key to response_code and the filtering rule to 400|500. This means only logs with response_code values of 400 or 500 will be collected. |
Upload hostname field | This feature determines whether to upload the hostname field. By default, it is disabled.
|
Parse collection path | Extract fields from the collection path by using regular expressions and add them as metadata to the log data. By default, this function is turned off. After enabling this feature, set the collection path sample, extract regular expression, and extract result.
|
HashKey routing shard | Specify the HashKey to write data into the log shard that meets the range requirements. By default, this feature is disabled.
|
Upload original log | This feature determines whether to upload the original log as a single field to TLS. By default, it is disabled.
|
Upload constant fields | After enabling, LogCollector will encapsulate key and value of the specified field in each log entry. Constant fields must follow these restrictions:
|
Upload host group label | You can select whether to upload the label information of the host group to TLS. By default, it is enabled.
|
Extended configuration | LogCollector extended configuration. It is written in JSON object format. Currently supported parameters include CloseInactive, CloseRemoved, CloseRenamed, CloseEOF, and CloseTimeout. For detailed parameter descriptions, see the Advanced data structure in CreateRule. For example, using the following configurations will cause: no new entry is written for 10 seconds; log file is removed; log file is renamed; LogCollector reads data to the end of file; the handle is released when log file monitoring exceeds 30 minutes. |