CreateLogtailPipelineConfig
Creates a Logtail pipeline configuration.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:CreateLogtailPipelineConfig |
create |
*All Resource
|
|
None |
Request syntax
POST /pipelineconfigs HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
The name of the project. |
test-project |
| body |
object |
No |
The content of the Logtail pipeline configuration. |
|
| configName |
string |
Yes |
The name of the configuration. Note
The configuration name must be unique within the project to which it belongs and cannot be modified after creation. The naming rules are as follows:
|
test-config |
| logSample |
string |
No |
The log sample. Multiple logs are supported. |
2022-06-14 11:13:29.796 | DEBUG | __main__: |
| global |
object |
No |
The global configuration. |
{ "topicType": "filepath", "topicFormat": "/var/log/(.*).log", "enableTimestampNanosecond": false } |
| inputs |
array<object> |
Yes |
The list of input plugins. Important Currently, you can configure only one input plugin. |
|
|
object |
No |
The input plugin. Note
For the parameters of the file input plugin, refer to File plugin. For the parameters of other input plugins, refer to Processing plugin. |
{ "Type": "input_file", "FilePaths": ["/var/log/*.log"] } |
|
| processors |
array<object> |
No |
The list of processing plugins. Note
Processing plugins are divided into native processing plugins and extended processing plugins. For more information, refer to Processing plugins. Important
Note
|
|
|
object |
No |
The processing plugin. Note
For more information about native processing plugins and extended processing plugins, refer to Processing plugins. |
{ "Type": "processor_parse_json_native", "SourceKey": "content" } |
|
| aggregators |
array<object> |
No |
The list of aggregator plugins. Important This is valid only when extended processing plugins are used, and you can use at most one aggregator plugin. |
[ { "type": "aggregator_context" } ] |
|
object |
No |
The aggregator plugin. |
{ "type": "aggregator_context" } |
|
| flushers |
array<object> |
Yes |
The list of output plugins. Important Currently, only one flusher_sls plugin is allowed. |
|
|
object |
No |
The output plugin. |
{ "Type": "flusher_sls", "Logstore": "test" } |
|
| task |
object |
No |
The task configuration. |
{ "maxLogSize": 524288, "flushIntervalMs": 3000 } |
Global configuration
| Parameter | Type | Required | Default value | Example | Description |
| TopicType | string | No | Empty | filepath | The topic type. Valid values:
|
| TopicFormat | string | No. Required when TopicType is set to filepath or custom | / | /var/log/(.*).log | The topic format. |
| EnableTimestampNanosecond | bool | No | false | false | Specifies whether to enable nanosecond precision for timestamps. |
| PipelineMetaTagKey | object | No | Empty | {"HOST_NAME":"__hostname__"} | Important Supported only in LoongCollector 3.0.10 and later.
|
Input plugins.
File input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | input_file | The plugin type. Set the value to input_file. |
| FilePaths | [string] | Yes | / | ["/var/log/*.log"] | The list of log file paths to be collected. Currently, only one path is supported. You can use the * and ** wildcards in the path. The ** wildcard can appear only once and must be used only before the file name. |
| MaxDirSearchDepth | uint | No | 0 | 0 | The maximum directory depth for the ** wildcard to match in the file path. This is valid only when the ** wildcard exists in the log path. Valid values: 0 to 1000. |
| ExcludeFilePaths | [string] | No | Empty | ["/home/admin/*.log"] | The blacklist of file paths. The paths must be absolute paths. The * wildcard is supported. |
| ExcludeFiles | [string] | No | Empty | ["app*.log", "password"] | The blacklist of file names. The * wildcard is supported. |
| ExcludeDirs | [string] | No | Empty | ["/home/admin/dir1", "/home/admin/dir2*"] | The blacklist of directories. The paths must be absolute paths. The * wildcard is supported. |
| FileEncoding | string | No | utf8 | utf8 | The file encoding format. Valid values: utf8 and gbk. |
| TailSizeKB | uint | No | 1024 | 1024 | The size from the end of the matched file to the starting collection position when the configuration takes effect for the first time. If the file size is less than this value, the collection starts from the beginning of the file. Valid values: 0 to 10485760. Unit: KB. |
| Multiline | object | No | Empty | / | The multiline aggregation options. |
| Multiline.Mode | string | No | custom | custom | The multiline aggregation mode. Valid values: custom and JSON. |
| Multiline.StartPattern | string | Required when Multiline.Mode is set to custom | Empty | \d+-\d+-\d+.* | The regular expression for the start of a line. |
| EnableContainerDiscovery | bool | No | false | true | Specifies whether to enable the container discovery feature. This is valid only when Logtail runs in DaemonSet mode and the collection file path is an in-container path. |
| ContainerFilters | object | No | Empty | / | The container filtering options. Multiple options are connected by the AND operator. This is valid only when EnableContainerDiscovery is set to true. |
| ContainerFilters.K8sNamespaceRegex | string | No | Empty | default | For containers deployed in a Kubernetes environment, specifies the namespace condition of the pod where the container to be collected resides. If this parameter is not added, all containers are collected. Regular expression matching is supported. |
| ContainerFilters.K8sPodRegex | string | No | Empty | test-pod | For containers deployed in a Kubernetes environment, specifies the name condition of the pod where the container to be collected resides. If this parameter is not added, all containers are collected. Regular expression matching is supported. |
| ContainerFilters.IncludeK8sLabel | map | No | Empty | / | For containers deployed in a Kubernetes environment, specifies the label condition of the pod where the container to be collected resides. Multiple conditions are connected by the OR operator. If this parameter is not added, all containers are collected. Regular expression matching is supported. The key in the map is the pod label name, and the value is the pod label value. Description:
|
| ContainerFilters.ExcludeK8sLabel | map | No | Empty | / | For containers deployed in a Kubernetes environment, specifies the label conditions to exclude the pods where the containers reside from log collection. Multiple conditions are evaluated with an OR operator. If this parameter is not specified, logs from all containers are collected. Regular expression matching is supported. The key in the map is the pod label name, and the value is the pod label value. Details:
|
| ContainerFilters.K8sContainerRegex | string | No | Empty | test-container | For containers deployed in a Kubernetes environment, specifies the name conditions of the containers from which logs are collected. If this parameter is not specified, logs from all containers are collected. Regular expression matching is supported. |
| ContainerFilters.IncludeEnv | map | No | Empty | / | Specifies the environment variable conditions of the containers from which logs are collected. Multiple conditions are evaluated with an OR operator. If this parameter is not specified, logs from all containers are collected. Regular expression matching is supported. The key in the map is the environment variable name, and the value is the environment variable value. Details:
|
| ContainerFilters.ExcludeEnv | map | No | Empty | / | Specifies the environment variable conditions to exclude containers from log collection. Multiple conditions are evaluated with an OR operator. If this parameter is not specified, logs from all containers are collected. Regular expression matching is supported. The key in the map is the environment variable name, and the value is the environment variable value. Details:
|
| ContainerFilters.IncludeContainerLabel | map | No | Empty | / | Specifies the label conditions of the containers from which logs are collected. Multiple conditions are evaluated with an OR operator. If this parameter is not specified, the default value is empty, which indicates that logs from all containers are collected. Regular expression matching is supported. The key in the map is the container label name, and the value is the container label value. Details:
|
| ContainerFilters.ExcludeContainerLabel | map | No | Empty | / | Specifies the label conditions to exclude containers from log collection. Multiple conditions are evaluated with an OR operator. If this parameter is not specified, the default value is empty, which indicates that logs from all containers are collected. Regular expression matching is supported. The key in the map is the container label name, and the value is the container label value. Details:
|
| ExternalK8sLabelTag | map | No | Empty | / | For containers deployed in a Kubernetes environment, specifies the additional tags related to pod labels to be added to logs. The key in the map is the pod label name, and the value is the corresponding tag name. For example, if you add app: k8s\_label\_app to the map and a pod contains the app=serviceA label, this information is added to the log as a tag, specifically the __tag__:k8s_label_app: serviceA field. If the pod does not contain the app label, an empty __tag__:k8s_label_app: field is added. |
| ExternalEnvTag | map | No | Empty | / | For containers deployed in a Kubernetes environment, specifies the additional tags related to container environment variables to be added to logs. The key in the map is the environment variable name, and the value is the corresponding tag name. For example, if you add VERSION: env\_version to the map and a container contains the VERSION=v1.0.0 environment variable, this information is added to the log as a tag, specifically the __tag__:env_version: v1.0.0 field. If the container does not contain the VERSION environment variable, an empty __tag__:env_version: field is added. |
| CollectingContainersMeta | bool | No | false | true | Specifies whether to enable the preview of container metadata. |
| AppendingLogPositionMeta | bool | No | false | false | Specifies whether to add the metadata of the file to which a log entry belongs to the log entry, including the __tag__:__inode__ field and the __file_offset__ field. |
| AllowingIncludedByMultiConfigs | bool | No | false | false | Specifies whether to allow the current configuration to collect logs from files that are already matched by other configurations. |
| Tags | object | No | Empty | {"FileInodeTagKey":"__inode__"} | Important Supported only in LoongCollector 3.0.10 and later.
|
| FileOffsetKey | string | No | Empty | __file_offset__ | Important Supported only in LoongCollector 3.0.10 and later. |
Container standard output (legacy)
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_docker_stdout | The type of the plug-in. Set the value to service_docker_stdout. |
| Stdout | Boolean | No | true | true | Specifies whether to collect standard output (stdout). |
| Stderr | Boolean | No | true | true | Specifies whether to collect standard error (stderr). |
| StartLogMaxOffset | Integer | No | 128×1024 | 131072 | The length of historical data to trace back during the first collection. Unit: bytes. Recommended values: 131072 to 1048576. |
| IncludeLabel | Map, where LabelKey and LabelValue are of the String type | No | Empty | The whitelist of container labels, which is used to specify the containers from which logs are collected. The default value is empty, which indicates that the standard output of all containers is collected. If you want to configure a whitelist of container labels, LabelKey is required and LabelValue is optional.
Multiple whitelists are evaluated with an OR operator. A container is matched as long as its labels meet any of the whitelists. | |
| ExcludeLabel | Map, where LabelKey and LabelValue are of the String type | No | Empty | The blacklist of container labels, which is used to exclude containers from log collection. The default value is empty, which indicates that no containers are excluded. If you want to configure a blacklist of container labels, LabelKey is required and LabelValue is optional.
Multiple blacklists are evaluated with an OR operator. A container is excluded as long as its labels meet any of the blacklists. | |
| IncludeEnv | Map, where EnvKey and EnvValue are of the String type | No | Empty | The whitelist of environment variables, which is used to specify the containers from which logs are collected. The default value is empty, which indicates that the standard output of all containers is collected. If you want to configure a whitelist of environment variables, EnvKey is required and EnvValue is optional.
| |
| ExcludeEnv | Map, where EnvKey and EnvValue are of the String type | No | Empty | The blacklist of environment variables, which is used to exclude containers from log collection. The default value is empty, which indicates that no containers are excluded. If you want to configure a blacklist of environment variables, EnvKey is required and EnvValue is optional.
Multiple blacklists are evaluated with an OR operator. A container is excluded as long as its environment variables meet any of the key-value pairs. | |
| IncludeK8sLabel | Map, where LabelKey and LabelValue are of the String type | No | Empty | The whitelist of Kubernetes labels (defined in template.metadata), which is used to specify the containers from which logs are collected. If you want to configure a whitelist of Kubernetes labels, LabelKey is required and LabelValue is optional.
Multiple whitelists are evaluated with an OR operator. A container is matched as long as its Kubernetes labels meet any of the whitelists. | |
| ExcludeK8sLabel | Map, where LabelKey and LabelValue are of the String type | No | Empty | The blacklist of Kubernetes labels (defined in template.metadata), which is used to exclude containers from log collection. If you want to configure a blacklist of Kubernetes labels, LabelKey is required and LabelValue is optional.
Multiple blacklists are evaluated with an OR operator. A container is excluded as long as its Kubernetes labels meet any of the blacklists. | |
| K8sNamespaceRegex | String | No | Empty | ^(default|nginx)$ | Specifies the namespaces of the containers from which logs are collected. Regular expression matching is supported. For example, if you set the value to ^(default|nginx)$, all containers in the nginx and default namespaces are matched. |
| K8sPodRegex | String | No | Empty | ^(nginx-log-demo.*)$ | Specifies the names of the pods where the containers from which logs are collected reside. Regular expression matching is supported. For example, if you set the value to ^(nginx-log-demo.*)$, all containers in pods whose names start with nginx-log-demo are matched. |
| K8sContainerRegex | String | No | Empty | ^(container-test)$ | Specifies the names of the containers from which logs are collected. Kubernetes container names are defined in spec.containers. Regular expression matching is supported. For example, if you set the value to ^(container-test)$, all containers named container-test are matched. |
Data processing parameters
| Parameter | Type | Required | Default value | Example | Description |
| BeginLineRegex | String | No | Empty | The regular expression used to match the first line of a log entry. If this parameter is empty, the single-line mode is used. If the expression matches the beginning of a line, the line is treated as a new log entry. Otherwise, the line is appended to the previous log entry. | |
| BeginLineCheckLength | Integer | No | Empty | The length of data checked for first-line matching. Unit: bytes. Default value: 10 × 1024. If the regular expression for first-line matching can be evaluated within the first N bytes, set this parameter to improve matching efficiency. | |
| BeginLineTimeoutMs | Integer | No | Empty | The timeout period for first-line matching. Unit: milliseconds. Default value: 3000. If no new logs appear within 3,000 milliseconds, the matching ends and the last log entry is uploaded to Simple Log Service. | |
| MaxLogSize | Integer | No | Empty | The maximum length of a log entry. Unit: bytes. Default value: 512 × 1024. If the length of a log entry exceeds this value, the system stops searching for the first line and directly uploads the log entry. | |
| ExternalK8sLabelTag | Map, where LabelKey and LabelValue are of the String type | No | Empty | After you configure Kubernetes labels (defined in template.metadata) as log tags, iLogtail adds Kubernetes label-related fields to logs. For example, if you set LabelKey to app and LabelValue to | |
| ExternalEnvTag | Map, where EnvKey and EnvValue are of the String type | No | Empty | After you configure container environment variables as log tags, iLogtail adds container environment variable-related fields to logs. For example, if you set EnvKey to |
Data processing environment variables
| Environment variable | Type | Required | Default value | Example | Description |
| ALIYUN_LOG_ENV_TAGS | String | No | Empty | After you configure global environment variables as log tags, iLogtail adds environment variable-related fields of the container where iLogtail resides to logs. Separate multiple environment variable names with For example, if you set the value to node_name|node_ip, and the relevant environment variables are exposed in the iLogtail container, this information is added to the log as tags, specifically the node_ip:172.16.0.1 and node_name:worknode fields. |
Container standard output (new version)
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | input_container_stdio | The type of the plug-in. Set the value to input_container_stdio. |
| IgnoringStdout | Boolean | No | false | false | Specifies whether to ignore standard output (stdout). A value of false indicates that stdout is collected. A value of true indicates that stdout is not collected. |
| IgnoringStderr | Boolean | No | false | false | Specifies whether to ignore standard error (stderr). A value of false indicates that stderr is collected. A value of true indicates that stderr is not collected. |
| TailSizeKB | Integer (uint) | No | 1024 | 2048 | The distance from the end of the file to the starting collection position when the configuration takes effect for the first time. Unit: KB. If the file size is smaller than this value, collection starts from the beginning of the file. Valid values: 0 to 104857600. |
| AllowingIncludedByMultiConfigs | Boolean | No | false | true | Specifies whether to allow the current configuration to collect standard output logs from containers that are already matched by other configurations. The default value false indicates that duplicate collection by multiple configurations is avoided. |
| ContainerFilters | Object | No | Empty | See the ContainerFilters table below | The container filtering options. Multiple options are evaluated with an AND operator. |
| ExternalK8sLabelTag | Map, where LabelKey and LabelValue are of the String type | No | Empty | {"app":"k8s_label_app"} | For Kubernetes scenarios: retrieves values from pod labels and appends them as fields (tags) to logs. The key in the map is the pod label name, and the value is the log field name (tag name). If the pod does not have the label, an empty field is appended. |
| ExternalEnvTag | Map, where EnvKey and EnvValue are of the String type | No | Empty | {"VERSION":"env_version"} | For container scenarios: retrieves values from container environment variables and appends them as fields (tags) to logs. The key in the map is the environment variable name, and the value is the log field name (tag name). If the container does not have the environment variable, an empty field is appended. |
| Multiline | Object | No | Empty | See the Multiline table below | The multiline aggregation options. |
Container filter options (ContainerFilters)
| Parameter | Type | Required | Default value | Example | Description |
| IncludeK8sLabel | Map, where LabelKey and LabelValue are strings | No | Empty | {"app":"^(test1|test2)$"} | The whitelist of Kubernetes labels (defined in the
Multiple whitelists are evaluated by using the OR operator. A container is matched if its Kubernetes labels meet any of the whitelists. |
| ExcludeK8sLabel | Map, where LabelKey and LabelValue are strings | No | Empty | {"env":"^(test.*)$"} | The blacklist of Kubernetes labels (defined in the
Multiple blacklists are evaluated by using the OR operator. A container is excluded if its Kubernetes labels meet any of the blacklists. |
| IncludeEnv | Map, where EnvKey and EnvValue are strings | No | Empty | {"NGINX_SERVICE_PORT":"^(80|6379)$"} | The whitelist of environment variables used to specify the containers from which logs are collected. Default value: empty, which indicates that the standard output of all containers is collected. If you want to configure an environment variable whitelist, EnvKey is required and EnvValue is optional.
Multiple whitelists are evaluated by using the OR operator. A container is matched if its environment variables meet any of the key-value pairs. |
| ExcludeEnv | Map, where EnvKey and EnvValue are strings | No | Empty | {"POD_NAMESPACE":"kube-system"} | The blacklist of environment variables used to exclude the containers from which logs are not collected. Default value: empty, which indicates that no containers are excluded. If you want to configure an environment variable blacklist, EnvKey is required and EnvValue is optional.
Multiple blacklists are evaluated by using the OR operator. A container is excluded if its environment variables meet any of the key-value pairs. |
| IncludeContainerLabel | Map, where LabelKey and LabelValue are strings | No | Empty | {"io.kubernetes.container.name":"nginx"} | The whitelist of container labels used to specify the containers from which logs are collected. Default value: empty, which indicates that the standard output of all containers is collected. If you want to configure a container label whitelist, LabelKey is required and LabelValue is optional.
Multiple whitelists are evaluated by using the OR operator. A container is matched if its container labels meet any of the whitelists. |
| ExcludeContainerLabel | Map, where LabelKey and LabelValue are strings | No | Empty | {"io.kubernetes.pod.namespace":"kube-system"} | The blacklist of container labels used to exclude the containers from which logs are not collected. Default value: empty, which indicates that no containers are excluded. If you want to configure a container label blacklist, LabelKey is required and LabelValue is optional.
Multiple blacklists are evaluated by using the OR operator. A container is excluded if its container labels meet any of the blacklists. |
Multiline aggregation options (Multiline)
| Parameter | Type | Required | Default value | Example | Description |
| Mode | String | No | custom | custom | The multiline aggregation mode. Valid values: custom and JSON. If you set the value to JSON, logs are read and concatenated in JSON format. |
| StartPattern | String | No (required in custom mode) | Empty | \d+-\d+-\d+.* | The regular expression used to match the first line of a log entry. A matched line is considered the start of a new log entry. |
| UnmatchedContentTreatment | String | No | single_line | discard | The processing method for unmatched log segments. Valid values: discard (discards the unmatched log segments) and single_line (outputs the unmatched log segments line by line as single-line logs). |
MySQL input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_mysql | The type of the plugin. Set the value to service_mysql. |
| Address | string | No | 127.0.0.1:3306 | rm-*.mysql.rds.aliyuncs.com | The endpoint of the MySQL database. |
| User | string | No | root | root | The username used to log on to the MySQL database. |
| Password | string | No | Empty | The password used to log on to the MySQL database. If you have high security requirements, we recommend that you set the username and password to xxx. After the collection configuration is synchronized to the local machine, find the corresponding configuration in the local file /usr/local/ilogtail/user_log_config.json and modify it. For more information, see Modify local configurations. Important If you modify this parameter in the console, the local configuration will be overwritten after synchronization. | |
| DataBase | string | No | / | project_database | The name of the database. |
| DialTimeOutMs | int | No | 5000 | 5000 | The timeout period for connecting to the MySQL database. Unit: milliseconds. |
| ReadTimeOutMs | int | No | 5000 | 5000 | The timeout period for reading MySQL query results. Unit: milliseconds. |
| StateMent | string | No | / | The SELECT statement. If CheckPoint is set to true, the WHERE clause of the SELECT statement in StateMent must contain the checkpoint column (CheckPointColumn). You can use a question mark (?) as a placeholder in conjunction with the checkpoint column. For example, if CheckPointColumn is set to id, CheckPointStart is set to 0, and StateMent is set to SELECT * from ... where id > ?, the system saves the ID of the last data record as the checkpoint after each collection. During the next collection, the question mark (?) in the query statement is replaced with the ID corresponding to the checkpoint. | |
| Limit | bool | No | false | true | Specifies whether to use LIMIT for pagination.
|
| PageSize | int | No | / | 10 | The page size. This parameter is required when Limit is set to true. |
| MaxSyncSize | int | No | 0 | 0 | The maximum number of records to synchronize at a time. Default value: 0, which indicates no limit. |
| CheckPoint | bool | No | false | true | Specifies whether to use a checkpoint.
|
| CheckPointColumn | string | No | Empty | 1 | The name of the checkpoint column. This parameter is required when CheckPoint is set to true. Warning The values in this column must be incremental. Otherwise, data may be missed during collection. The maximum value in each query result is used as the input for the next query. |
| CheckPointColumnType | string | No | Empty | int | The data type of the checkpoint column. Valid values: int and time. The int type is stored internally as int64. The time type supports the date, datetime, and time types in MySQL. This parameter is required when CheckPoint is set to true. |
| CheckPointStart | string | No | Empty | The initial value of the checkpoint column. This parameter is required when CheckPoint is set to true. | |
| CheckPointSavePerPage | bool | No | true | true | Specifies whether to save a checkpoint each time a page is turned.
|
| IntervalMs | int | No | 60000 | 60000 | The synchronization interval. Default value: 60000. Unit: milliseconds. |
HTTP input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | metric_http | The type of the plugin. Set the value to metric_http. |
| Address | string | Yes | / | The list of URLs. Important The URLs must start with http or https. | |
| IntervalMs | int | Yes | / | 10 | The interval between requests. Unit: milliseconds. |
| Method | string | No | GET | GET | The HTTP request method. The value must be in uppercase. |
| Body | string | No | Empty | The content of the HTTP body field. | |
| Headers | map | No | Empty | {"key":"value"} | The content of the HTTP header, such as {"key":"value"}. Replace the value with the actual value. |
| PerAddressSleepMs | int | No | 100 | 100 | The interval between requests for each URL in the Addresses list. Unit: milliseconds. |
| ResponseTimeoutMs | int | No | 5000 | 5000 | The request timeout period. Unit: milliseconds. |
| IncludeBody | bool | No | false | true | Specifies whether to collect the request body. Default value: false. If the value is set to true, the content of the request body is stored in the key named content. |
| FollowRedirects | bool | No | false | false | Specifies whether to automatically handle redirects. |
| InsecureSkipVerify | bool | No | false | false | Specifies whether to skip HTTPS security checks. |
| ResponseStringMatch | string | No | / | The regular expression used to check the returned body content. The check result is stored in the key named response_match. If the content matches the regular expression, the value is yes. If the content does not match the regular expression, the value is no. |
Syslog input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_syslog | The type of the plugin. Set the value to service_syslog. |
| Address | string | No | tcp://127.0.0.1:9999 | The protocol, IP address, and port that Logtail listens on. Logtail listens and obtains log data based on the Logtail configuration. Format: [tcp/udp]://[ ip ]:[ port ]. If this parameter is not configured, the default value tcp://127.0.0.1:9999 is used, which indicates that only locally forwarded logs can be received. Note
| |
| ParseProtocol | string | No | Empty | rfc3164 | The protocol used to parse logs. Default value: empty, which indicates that logs are not parsed. Valid values:
|
| IgnoreParseFailure | bool | No | true | true | The action to take after a parsing failure. If this parameter is not configured, the default value true is used, which indicates that parsing is abandoned and the returned content field is directly populated. If the value is set to false, logs are discarded when parsing fails. |
Systemd Journal input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_journal | The type of the plugin. Set the value to service_journal. |
| JournalPaths | [string] | Yes | Empty | /var/log/journal | The path to Journal logs. We recommend that you set this parameter to the directory where Journal logs are stored. |
| SeekPosition | string | No | tail | tail | The collection mode for the first time. Valid values:
|
| Kernel | bool | No | true | true | Specifies whether to collect kernel logs. |
| Units | [string] | No | Empty | "" | The list of units to collect. Default value: empty, which indicates that all units are collected. |
| ParseSyslogFacility | bool | No | false | false | Specifies whether to parse the facility field of syslog logs. If this parameter is not configured, the field is not parsed. |
| ParsePriority | bool | No | false | false | Specifies whether to parse the Priority field. If this parameter is not configured, the field is not parsed. If the value is set to true, the mapping of the Priority field is as follows: plaintext "0": "emergency" "1": "alert" "2": "critical" "3": "error" "4": "warning" "5": "notice" "6": "informational" "7": "debug" |
| UseJournalEventTime | bool | No | false | false | Specifies whether to use the fields in Journal logs as the log time. If this parameter is not configured, the collection time is used as the log time. The delay for real-time log collection is generally within 3 seconds. |
SQL Server input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_mssql | The type of the plug-in. Set the value to service_mssql. |
| Address | string | No | 127.0.0.1:1433 | rm-*.sqlserver.rds.aliyuncs.com | The address of the SQL Server database. |
| User | string | No | root | root | The username used to log on to the SQL Server database. |
| Password | string | No | Empty | The password used to log on to the SQL Server database. If you have high security requirements, set the username and password to xxx. After the collection configuration is synchronized to the local machine, find the corresponding configuration in the local file /usr/local/ilogtail/user_log_config.json and modify it. For more information, see Modify local configurations. Important If you modify this parameter in the console, the local configuration is overwritten after synchronization. | |
| DataBase | string | No | / | project_database | The name of the database. |
| DialTimeOutMs | int | No | 5000 | 5000 | The timeout period for connecting to the SQL Server database. Unit: milliseconds. |
| ReadTimeOutMs | int | No | 5000 | 5000 | The timeout period for reading SQL Server query results. Unit: milliseconds. |
| StateMent | string | No | / | The SELECT statement. If you set CheckPoint to true, the WHERE clause of the SELECT statement in StateMent must include the checkpoint column (CheckPointColumn). You can use a question mark (?) as a placeholder in combination with the checkpoint column. For example, if you set CheckPointColumn to id, CheckPointStart to 0, and StateMent to SELECT * from ... where id > ?, the system saves the ID of the last data record as the checkpoint after each collection. During the next collection, the question mark (?) in the query statement is replaced with the ID corresponding to the checkpoint. | |
| Limit | bool | No | false | true | Specifies whether to use LIMIT for pagination. Valid values:
|
| PageSize | int | No | / | 10 | The page size. This parameter is required if Limit is set to true. |
| MaxSyncSize | int | No | 0 | 0 | The maximum number of records to synchronize at a time. Default value: 0, which indicates no limit. |
| CheckPoint | bool | No | false | true | Specifies whether to use a checkpoint. Valid values:
|
| CheckPointColumn | string | No | Empty | 1 | The name of the checkpoint column. This parameter is required if CheckPoint is set to true. Warning The values in this column must be incremental. Otherwise, data loss may occur during collection. The maximum value in each query result is used as the input for the next query. |
| CheckPointColumnType | string | No | Empty | int | The data type of the checkpoint column. Valid values: int and time. The int type is internally stored as int64. The time type supports the date, datetime, and time types of SQL Server. This parameter is required if CheckPoint is set to true. |
| CheckPointStart | string | No | Empty | The initial value of the checkpoint column. This parameter is required if CheckPoint is set to true. | |
| CheckPointSavePerPage | bool | No | true | true | Specifies whether to save the checkpoint upon each pagination. Valid values:
|
| IntervalMs | int | No | 60000 | 60000 | The synchronization interval. Default value: 60000. Unit: milliseconds. |
PostgreSQL input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | service_pgsql | The type of the plug-in. Set the value to service_pgsql. |
| Address | string | No | 127.0.0.1:5432 | rm-*.pg.rds.aliyuncs.com | The address of the PostgreSQL database. |
| User | string | No | root | root | The username used to log on to the PostgreSQL database. |
| Password | string | No | Empty | The password used to log on to the PostgreSQL database. If you have high security requirements, set the username and password to xxx. After the collection configuration is synchronized to the local machine, find the corresponding configuration in the local file /usr/local/ilogtail/user_log_config.json and modify it. For more information, see Modify local configurations. Important If you modify this parameter in the console, the local configuration is overwritten after synchronization. | |
| DataBase | string | No | / | project_database | The name of the PostgreSQL database. |
| DialTimeOutMs | int | No | 5000 | 5000 | The timeout period for connecting to the PostgreSQL database. Unit: milliseconds. |
| ReadTimeOutMs | int | No | 5000 | 5000 | The timeout period for reading PostgreSQL query results. Unit: milliseconds. |
| StateMent | string | No | / | The SELECT statement. If you set CheckPoint to true, the WHERE clause of the SELECT statement in StateMent must include the checkpoint column (CheckPointColumn parameter), and the value of this column must be set to $1. For example, if you set CheckPointColumn to id and StateMent to SELECT * from ... where id > $1. | |
| Limit | bool | No | false | true | Specifies whether to use LIMIT for pagination. Valid values:
|
| PageSize | int | No | / | 10 | The page size. This parameter is required if Limit is set to true. |
| MaxSyncSize | int | No | 0 | 0 | The maximum number of records to synchronize at a time. Default value: 0, which indicates no limit. |
| CheckPoint | bool | No | false | true | Specifies whether to use a checkpoint. Valid values:
|
| CheckPointColumn | string | No | Empty | 1 | The name of the checkpoint column. This parameter is required if CheckPoint is set to true. Warning The values in this column must be incremental. Otherwise, data loss may occur during collection. The maximum value in each query result is used as the input for the next query. |
| CheckPointColumnType | string | No | Empty | int | The data type of the checkpoint column. Valid values: int and time. The int type is internally stored as int64. The time type supports the time types of PostgreSQL. This parameter is required if CheckPoint is set to true. |
| CheckPointStart | string | No | Empty | The initial value of the checkpoint column. This parameter is required if CheckPoint is set to true. | |
| CheckPointSavePerPage | bool | No | true | true | Specifies whether to save the checkpoint upon each pagination. Valid values:
|
| IntervalMs | int | No | 60000 | 60000 | The synchronization interval. Default value: 60000. Unit: milliseconds. |
SNMP protocol input plugin
| Parameter | Type | Required | Default value | Example | Description |
| Targets | [string] | Yes | / | 127.0.0.1 | The IP addresses of the target machine group. |
| Port | string | No | 161 | 161 | The port used by the SNMP protocol. |
| Community | string | No | public | public | The community name. SNMPv1 and SNMPv2 use the community name for authentication. |
| UserName | string | No | Empty | root | The username. SNMPv3 supports authentication by using a username. |
| AuthenticationProtocol | string | No | NoAuth | NoAuth | The authentication protocol. SNMPv3 supports authentication by using an authentication protocol. |
| AuthenticationPassphrase | string | No | Empty | The authentication password. Default value: empty. If you set AuthenticationProtocol to MD5 or SHA, you must set AuthenticationPassphrase. | |
| PrivacyProtocol | string | No | NoPriv | NoPriv | The privacy protocol. SNMPv3 supports authentication by using a privacy protocol. |
| PrivacyPassphrase | string | No | Empty | The privacy protocol password. The default value is the same as the authentication password. If you set PrivacyProtocol to DES or AES, you must set PrivacyPassphrase. | |
| Timeout | int | No | 5 | 5 | The timeout period for a single query operation. Unit: seconds. |
| Version | int | No | 2 | 2 | The SNMP protocol version. Valid values: 1, 2, and 3. |
| Transport | string | No | udp | udp | The SNMP communication method. Valid values: udp and tcp. |
| MaxRepetitions | int | No | 0 | 0 | The number of retries after a query times out. |
| Oids | [string] | No | Empty | 1 | The object identifiers (OIDs) to query on the target machine. |
| Fields | [string] | No | Empty | int | The fields to query on the target machine. This plug-in first translates the fields by looking up the local Management Information Base (MIB), translates them into OIDs, and then queries them together. |
| Tables | [string] | No | Empty | The tables to query on the target machine. This plug-in first queries all fields in the tables, looks up the local MIB, translates them into OIDs, and then queries them together. |
Script output collection plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | input_command | The plugin type. Set the value to input_command. |
| ScriptType | string | Yes | Empty | shell | The type of the script content. Valid values: bash, shell, python2, and python3. |
| User | string | Yes | / | public | The username used to run the command. Only non-root users are supported. Note * Make sure that the specified username exists on the machine. Configure the minimum permissions and grant only the read, write, and execute (rwx) permissions on the required directories or files. |
| ScriptContent | string | Yes | Empty | The script content. Plain text and Base64-encoded content are supported. The maximum length is 512 × 1024 bytes. | |
| ContentEncoding | string | No | PlainText | PlainText | The text format of the script content. Valid values:
|
| LineSplitSep | string | No | Empty | The delimiter used to split the script output. If this parameter is left empty, the output is not split and is returned as a single piece of data. | |
| CmdPath | string | No | Empty | /usr/bin/bash | The path used to execute the script command. If this parameter is left empty, the default path is used. Default paths:
|
| TimeoutMilliSeconds | int | No | 3000 | 3000 | The timeout period for executing the script. Unit: milliseconds. |
| IgnoreError | bool | No | false | false | Specifies whether to ignore error logs when the plugin execution fails. Default value: false, which indicates that error logs are not ignored. |
| Environments | [string] | No | The environment variables. The default value is the value of os.Environ(). If Environments is specified, the specified environment variables are appended to the value of os.Environ(). | ||
| IntervalMs | int | No | 5000 | 5000 | The collection trigger frequency or script execution frequency. Unit: milliseconds. |
Native processing plugins.
Regex parsing native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_parse_regex_native | The plugin type. Set the value to processor_parse_regex_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| Regex | string | Yes | / | (\d+-\d+-\d+)\s+(.*) | The regular expression. |
| Keys | [string] | Yes | / | ["time", "msg"] | The list of extracted fields. |
| KeepingSourceWhenParseFail | bool | No | false | false | Specifies whether to retain the source field when parsing fails. |
| KeepingSourceWhenParseSucceed | bool | No | false | false | Specifies whether to retain the source field when parsing succeeds. |
| RenamedSourceKey | string | No | Empty | key | The name of the field used to store the source field when the source field is retained. If this parameter is left empty, the source field is not renamed by default. |
JSON parsing native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_parse_json_native | The plugin type. Set the value to processor_parse_json_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| KeepingSourceWhenParseFail | bool | No | false | false | Specifies whether to retain the source field when parsing fails. |
| KeepingSourceWhenParseSucceed | bool | No | false | false | Specifies whether to retain the source field when parsing succeeds. |
| RenamedSourceKey | string | No | Empty | key | The name of the field used to store the source field when the source field is retained. If this parameter is left empty, the source field is not renamed by default. |
Delimiter parsing native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_parse_delimiter_native | The plugin type. Set the value to processor_parse_delimiter_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| Separator | string | Yes | / | , | The delimiter. |
| Quote | string | No | " | " | The quote character. |
| Keys | [string] | Yes | / | ["time", "msg"] | The list of extracted fields. |
| AllowingShortenedFields | bool | No | true | true | Specifies whether to allow the number of extracted fields to be less than the number of fields specified in Keys. If this parameter is set to false, this scenario is considered a parsing failure. |
| OverflowedFieldsTreatment | string | No | extend | extend | The action to take when the number of extracted fields is greater than the number of fields specified in Keys. Valid values:
|
| KeepingSourceWhenParseFail | bool | No | false | false | Specifies whether to retain the source field when parsing fails. |
| KeepingSourceWhenParseSucceed | bool | No | false | false | Specifies whether to retain the source field when parsing succeeds. |
| RenamedSourceKey | string | No | Empty | key | The name of the field used to store the source field when the source field is retained. If this parameter is left empty, the source field is not renamed by default. |
Apsara parsing native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_parse_apsara_native | The plugin type. Set the value to processor_parse_apsara_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| Timezone | string | No | Empty | GMT+08:00 | The time zone of the log time. The format is GMT+HH:MM (east zone) or GMT-HH:MM (west zone). |
| KeepingSourceWhenParseFail | bool | No | false | false | Specifies whether to retain the source field when parsing fails. |
| KeepingSourceWhenParseSucceed | bool | No | false | false | Specifies whether to retain the source field when parsing succeeds. |
| RenamedSourceKey | string | No | Empty | key | The name of the field used to store the source field when the source field is retained. If this parameter is left empty, the source field is not renamed by default. |
Time parsing native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_parse_timestamp_native | The plugin type. Set the value to processor_parse_timestamp_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| SourceFormat | string | Yes | / | %Y/%m/%d %H:%M:%S | The log time format. For more information, see Time formats. |
| SourceTimezone | string | No | Empty | GMT+08:00 | The time zone of the log time. The format is GMT+HH:MM (east zone) or GMT-HH:MM (west zone). |
Filtering native processing plugin
| Parameter | Type | Required | Example | Default value | Description |
| Type | string | Yes | processor_filter_regex_native | / | The plugin type. Set the value to processor_filter_regex_native. |
| Include | map | Yes | / | / | The whitelist of log fields. The key is the field name and the value is a regular expression, which specifies the condition that the field content must meet for the current event to be collected. Multiple conditions are connected by the AND operator. A log is collected only when all conditions are met. |
Data masking native processing plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_desensitize_native | The plugin type. Set the value to processor_desensitize_native. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| Method | string | Yes | / | const | The data masking method. Valid values: const: replaces sensitive content with a constant. md5: replaces sensitive content with its MD5 hash value. |
| ReplacingString | string | No. Required when Method is set to const | / | ****** | The constant string used to replace sensitive content. |
| ContentPatternBeforeReplacedString | string | Yes | / | 'password:' | The prefix regular expression for sensitive content. |
| ReplacedContentPattern | string | Yes | / | [^']* | The regular expression for sensitive content. |
| ReplacingAll | bool | No | true | true | Specifies whether to replace all matched sensitive content. |
Extended processing plugins.
Extract fields.
Regex mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_regex | The plugin type. Set the value to processor_regex. |
| SourceKey | string | Yes | / | content | The name of the source field. |
| Regex | string | Yes | / | (\d+-\d+-\d+)\s+(.*) | The regular expression. You must use half-width parentheses () to enclose the fields to be extracted. |
| Keys | [string] | Yes | / | ["ip", "time", "method"] | The field names specified for the extracted content, such as ["ip", "time", "method"]. |
| NoKeyError | boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| NoMatchError | boolean | No | false | false | Specifies whether the system reports an error when the specified regular expression does not match the value of the source field.
|
| KeepSource | boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
| FullMatch | boolean | No | true | true | Specifies whether to extract fields only when a full match is achieved.
|
| KeepSourceIfParseError | boolean | Yes | true | false | Specifies whether to retain the source field in the parsed log when log parsing fails.
|
Anchor mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_anchor | The plugin type. Set the value to processor_anchor. |
| SourceKey | Anchor array | Yes | / | content | The name of the source field. |
| Anchors | string | Yes | / | The list of anchor items. | |
| Start | String | Yes | Empty | time | The start keyword. If this parameter is left empty, it matches the beginning of the string. |
| Stop | String | Yes | Empty | \t | The end keyword. If this parameter is left empty, it matches the end of the string. |
| FieldName | String | Yes | Empty | time | The field name specified for the extracted content. |
| FieldType | String | Yes | Empty | string | The field type. Valid values: string and json. |
| ExpondJson | boolean | No | false | false | Specifies whether to expand JSON.
|
| ExpondConnecter | String | No | _ | _ | The connector used for JSON expansion. Default value: underscore (_). |
| MaxExpondDepth | Int | No | 0 | 0 | The maximum depth for JSON expansion. Default value: 0, which indicates no limit. |
| NoAnchorError | Boolean | No | false | false | Specifies whether the system reports an error when no anchor item is found. {#3f246206721du}
|
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| KeepSource | Boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
CSV mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_csv | The plugin type. Set the value to processor_csv. |
| SourceKey | String | Yes | / | csv | The name of the source field. |
| SplitKeys | String array | Yes | / | ["date", "ip", "content"] | The field names specified for the extracted content, such as ["date", "ip", "content"]. Important If the number of fields to be split is less than the number of fields in the SplitKeys parameter, the extra fields in the SplitKeys parameter are ignored. |
| PreserveOthers | Boolean | No | false | false | Specifies whether to retain the excess part when the number of fields to be split is greater than the number of fields in the SplitKeys parameter.
|
| ExpandOthers | Boolean | No | false | false | Specifies whether to parse the excess part.
|
| ExpandKeyPrefix | String | No | The naming prefix for the excess fields. For example, if this parameter is set to expand_, the field names are expand_1 and expand_2. | ||
| TrimLeadingSpace | Boolean | No | false | false | Specifies whether to ignore leading spaces in field values.
|
| SplitSep | String | No | , | , | The delimiter. Default value: comma (,). |
| KeepSource | Boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
Single-character delimiter mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_split_char | The plugin type. Set the value to processor_split_char. |
| SourceKey | String | Yes | The name of the source field. | ||
| SplitSep | String | Yes | The delimiter. It must be a single character and can be an invisible character, such as \u0001. | ||
| SplitKeys | String array | Yes | ["ip", "time", "method"] | The field names specified for the extracted content, such as ["ip", "time", "method"]. | |
| PreserveOthers | Boolean | No | false | false | Specifies whether to retain the excess part when the number of fields to be split is greater than the number of fields in the SplitKeys parameter.
|
| QuoteFlag | Boolean | No | false | false | Specifies whether to use a quote character.
|
| Quote | String | No | / | \u0001 | The quote character. It must be a single character and can be an invisible character, such as \u0001. This parameter takes effect only when QuoteFlag is set to true. |
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| NoMatchError | Boolean | No | false | false | Specifies whether the system reports an error when the specified delimiter does not match the delimiter in the log.
|
| KeepSource | Boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
Multi-character delimiter mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_split_string | The plugin type. Set the value to processor_split_string. |
| SourceKey | String | Yes | The name of the source field. | ||
| SplitSep | String | Yes | The delimiter. It must be a single character. You can set it to an invisible character, such as \u0001 or \u0002. | ||
| SplitKeys | String array | Yes | ["key1","key2"] | The field names specified for the extracted content, such as ["key1","key2"]. Note If the number of fields to be split is less than the number of fields in the SplitKeys parameter, the extra fields in the SplitKeys parameter are ignored. | |
| PreserveOthers | Boolean | No | false | false | Specifies whether to retain the excess part when the number of fields to be split is greater than the number of fields in the SplitKeys parameter.
|
| ExpandOthers | Boolean | No | false | false | Specifies whether to use a quote character.
|
| ExpandKeyPrefix | String | No | / | expand_ | The naming prefix for the excess part. For example, if you set this parameter to expand_, the field names are expand_1 and expand_2. |
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| NoMatchError | Boolean | No | false | false | Specifies whether the system reports an error when the specified delimiter does not match the delimiter in the log.
|
| KeepSource | Boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
Key-value pair mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_split_key_value | The plugin type. Set the value to processor_split_key_value. |
| SourceKey | string | Yes | The name of the source field. | ||
| Delimiter | string | No | \t | \t | The delimiter between key-value pairs. Default value: tab (\t). |
| Separator | string | No | : | : | The delimiter between the key and the value in a single key-value pair. Default value: half-width colon (:). |
| KeepSource | Boolean | No | false | false | Specifies whether to retain the source field in the parsed log.
|
| ErrIfSourceKeyNotFound | Boolean | No | true | false | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| DiscardWhenSeparatorNotFound | Boolean | No | false | false | Specifies whether to discard the key-value pair when no matching delimiter is found.
|
| ErrIfSeparatorNotFound | Boolean | No | true | false | Specifies whether the system reports an error when the specified delimiter does not exist.
|
| ErrIfKeyIsEmpty | Boolean | No | true | false | Specifies whether the system reports an error when the split key is empty.
|
| Quote | String | No | The quote character. If this parameter is set and a value is enclosed by the quote character, the value within the quote character is extracted. Multi-character quote characters are supported. By default, the quote character feature is disabled. Important * If the quote character is a double quotation mark (""), you must add an escape character, which is a backslash (\). If a backslash (\) is used together with the quote character within the quote character, the backslash (\) is output as part of the value. |
Grok mode
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_grok | The plugin type. Set the value to processor_grok. |
| CustomPatternDir | String array | No | The directory where the custom Grok pattern files are located. The processor_grok plugin reads all files in the directory. If this parameter is not added, custom Grok pattern files are not imported. Important After you update the custom Grok pattern files, you must restart Logtail for the updates to take effect. | ||
| CustomPatterns | Map | No | The custom Grok patterns. The key is the rule name, and the value is the Grok expression. For the default supported expressions, see processor_grok. If the link does not contain the expression you need, enter a custom Grok expression in Match. If this parameter is not added, custom Grok patterns are not used. | ||
| SourceKey | String | No | content | content | The name of the source field. Default value: content. |
| Match | String array | Yes | The array of Grok expressions. The processor_grok plugin matches logs against the expression list configured here from top to bottom, and returns the extraction result of the first successful match. Note Configuring multiple Grok expressions may affect performance. We recommend that you configure no more than 5 expressions. | ||
| TimeoutMilliSeconds | Long | No | 0 | The maximum attempt time for extracting fields by using Grok expressions. Unit: milliseconds. If this parameter is not added or is set to 0, no timeout occurs. | |
| IgnoreParseFailure | Boolean | No | true | true | Specifies whether to ignore logs that fail to be parsed.
|
| KeepSource | Boolean | No | true | true | Specifies whether to retain the source field after the log is successfully parsed.
|
| NoKeyError | Boolean | No | false | true | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| NoMatchError | Boolean | No | true | true | Specifies whether the system reports an error when none of the expressions set in the Match parameter match the log.
|
| TimeoutError | Boolean | No | true | true | Specifies whether the system reports an error when a match times out.
|
Add fields
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_add_fields | The plugin type. Set the value to processor_add_fields. |
| Fields | Map | Yes | The names and values of the fields to be added. The format is key-value pairs. You can add multiple fields. | ||
| IgnoreIfExist | Boolean | No | false | false | Specifies whether to ignore duplicate fields when fields with the same name exist.
|
Drop fields
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_drop | The plugin type. Set the value to processor_drop. |
| DropKeys | String array | Yes | The fields to be dropped. You can specify multiple fields. |
Rename fields
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_rename | The plugin type. Set the value to processor_rename. |
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error when the specified source field does not exist in the log.
|
| SourceKeys | String array | Yes | The source fields to be renamed. | ||
| DestKeys | String array | Yes | The renamed fields. |
Pack fields
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_packjson | The plugin type. Set the value to processor_packjson. |
| SourceKeys | String array | Yes | The source fields to be packed. | ||
| DestKey | String | No | The packed field. | ||
| KeepSource | Boolean | No | true | true | Specifies whether to retain the source fields in the parsed log.
|
| AlarmIfIncomplete | Boolean | No | true | true | Specifies whether the system reports an error when the specified source fields do not exist in the raw log.
|
Expand JSON fields
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_json | The plugin type. Set the value to processor_json. |
| SourceKey | String | Yes | The name of the source field to be expanded. | ||
| NoKeyError | Boolean | No | true | true | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| ExpandDepth | Int | No | 0 | 1 | The depth of JSON expansion. Default value: 0, which indicates no limit. 1 indicates the current level, and so on. |
| ExpandConnector | String | No | _ | _ | The connector used when expanding JSON. Default value: underscore (_). |
| Prefix | String | No | The prefix attached to the field names when expanding JSON. | ||
| KeepSource | Boolean | No | true | true | Specifies whether to retain the source field in the parsed log.
|
| UseSourceKeyAsPrefix | Boolean | No | Specifies whether to use the source field name as the prefix for all expanded JSON field names. | ||
| KeepSourceIfParseError | Boolean | No | true | true | Specifies whether to retain the raw log when log parsing fails.
|
| ExpandArray | Boolean | No | false | false | Specifies whether to expand array types. This parameter is supported in Logtail 1.8.0 and later.
|
Filter logs
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_filter_regex | The plugin type. Set the value to processor_filter_regex. |
| Include | JSON object | No | The key is the log field, and the value is the regular expression that matches the field value. The relationship between key-value pairs is AND. If the value of the log field matches the corresponding regular expression, the log is collected. | ||
| Exclude | JSON object | No | The key is the log field, and the value is the regular expression that matches the field value. The relationship between key-value pairs is OR. If the value of any field in the log matches the corresponding regular expression, the log is discarded. |
Extract log time
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_gotime | The plugin type. Set the value to processor_gotime. |
| SourceKey | String | Yes | The name of the source field. | ||
| SourceFormat | String | Yes | The format of the source time. | ||
| SourceLocation | Int | Yes | The time zone of the source time. If this parameter is empty, it indicates the time zone of the host or container where Logtail resides. | ||
| DestKey | String | Yes | The destination field after parsing. | ||
| DestFormat | String | Yes | The time format after parsing. | ||
| DestLocation | Int | No | The time zone after parsing. If this parameter is empty, it indicates the local time zone. | ||
| SetTime | Boolean | No | true | true | Specifies whether to set the parsed time as the log time.
|
| KeepSource | Boolean | No | true | true | Specifies whether to retain the source field in the parsed log.
|
| NoKeyError | Boolean | No | true | true | Specifies whether the system reports an error when the specified source field does not exist in the raw log.
|
| AlarmIfFail | Boolean | No | true | true | Specifies whether the system reports an error when log time extraction fails.
|
Convert IP addresses
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_geoip | The type of the plugin. Set the value to processor_geoip. |
| SourceKey | String | Yes | The name of the original field whose IP address you want to convert. | ||
| DBPath | String | Yes | /user/data/GeoLite2-City_20180102/GeoLite2-City.mmdb | The full path of the GeoIP database. Example: /user/data/GeoLite2-City_20180102/GeoLite2-City.mmdb. | |
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error if the specified original field does not exist in the raw log.
|
| NoMatchError | Boolean | No | true | true | Specifies whether the system reports an error if the IP address is invalid or not found in the database.
|
| KeepSource | Boolean | No | true | true | Specifies whether to retain the original field in the parsed log.
|
| Language | String | No | zh-CN | zh-CN | The language attribute. Default value: zh-CN. Important Make sure that your GeoIP database contains the specified language. |
Data masking
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_desensitize | The type of the plugin. Set the value to processor_desensitize. |
| SourceKey | String | Yes | The name of the log field. | ||
| Method | String | Yes | const | The masking method. Valid values:
| |
| Match | String | No | full | full | The method used to extract sensitive content. Valid values:
|
| ReplaceString | String | No | The string used to replace sensitive content. This parameter is required if you set Method to const. | ||
| RegexBegin | String | No | The regular expression used to match the prefix of sensitive content. This parameter is required if you set Match to regex. | ||
| RegexContent | String | No | The regular expression used to match sensitive content. This parameter is required if you set Match to regex. |
Field value mapping
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_dict_map | The type of the plugin. Set the value to processor_dict_map. |
| SourceKey | String | Yes | The name of the original field. | ||
| MapDict | Map | No | The mapping dictionary. If the mapping dictionary is small, you can configure it directly by using this parameter without providing a local CSV dictionary file. Important If you configure the DictFilePath parameter, the configuration in the MapDict parameter does not take effect. | ||
| DictFilePath | String | No | The path of the dictionary file in CSV format. The CSV file uses commas (,) as separators and double quotation marks (") for field references. | ||
| DestKey | String | No | The name of the mapped field. | ||
| HandleMissing | Boolean | No | false | false | Specifies whether the system processes the log if the target field is missing in the raw log.
|
| Missing | String | No | Unknown | Unknown | The fill value for the missing target field in the raw log. Default value: Unknown. The parameter settings take effect only when HandleMissing is set to true. |
| MaxDictSize | Int | No | 1000 | 1000 | The maximum size of the mapping dictionary. Default value: 1000, which means up to 1,000 mapping rules can be stored. To limit the memory usage of the plugin on the server, you can decrease this value. |
| Mode | String | No | overwrite | overwrite | The processing method when the mapped field already exists in the raw log.
|
Field encryption
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_encrypt | The type of the plugin. Set the value to processor_encrypt. |
| SourceKey | String array | Yes | The name of the original field. | ||
| EncryptionParameters | Object | Yes | The key-related configurations. | ||
| Key | String | Yes | The encryption key, which must be 64 hexadecimal characters. | ||
| IV | String | No | 00000000000000000000000000000000 | The initialization vector for encryption, which must be 32 hexadecimal characters. Default value: 00000000000000000000000000000000. | |
| KeyFilePath | Boolean | No | The path of the file from which encryption parameters are read. If this parameter is not configured, the file is read based on Logtail configuration - Input configuration - File path. | ||
| KeepSourceValueIfError | String | No | false | false | Specifies whether the system retains the value of the original field if encryption fails.
ENCRYPT_ERROR. |
String replacement
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_string_replace | The type of the plugin. Set the value to processor_string_replace. |
| SourceKey | String | Yes | The name of the original field. | ||
| Method | String | Yes | The matching method. Valid values:
| ||
| Match | String | No | The match content.
| ||
| ReplaceString | String | No | The string used for replacement. Default value: "".
| ||
| DestKey | String | No | The new field for the replaced content. By default, no new field is added. |
Data encoding and decoding
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_base64_encoding | The type of the plugin. Set the value to processor_base64_encoding. |
| SourceKey | String | Yes | The name of the original field. | ||
| NewKey | String | Yes | The name of the result field after encoding. | ||
| NoKeyError | Boolean | No | false | false | Specifies whether the system reports an error if the specified original field does not exist in the raw log.
|
Convert logs to metrics
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_log_to_sls_metric | The type of the plugin. Set the value to processor_log_to_sls_metric. |
| MetricTimeKey | String | No | The time field in the log, which is mapped to the __time_nano__ field in the time series data. By default, the value of the __time__ field in the log is extracted. Make sure that the specified field is a valid and properly formatted timestamp. Unix timestamps in seconds (10 digits), milliseconds (13 digits), microseconds (16 digits), and nanoseconds (19 digits) are supported. | ||
| MetricLabelKeys | []String | Yes | The list of keys for the __labels__ field. The keys must follow the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$. The values cannot contain vertical bars (|) or #$#. For more information, see Time series data (Metric). You cannot add the __labels__ field to the MetricLabelKeys parameter. If the __labels__ field exists in the original fields, its value is appended to the new __labels__ field. | ||
| MetricValues | Map | Yes | The metric names and metric values. The metric name corresponds to the __name__ field and must follow the regular expression ^[a-zA-Z_:][a-zA-Z0-9_:]*$. The metric value corresponds to the __value__ field and must be of the Double type. For more information, see Time series data (Metric). | ||
| CustomMetricLabels | Map | No | The custom __labels__ field. The keys must follow the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$, and the values cannot contain vertical bars (|) or #$#. For more information, see Time series data (Metric). | ||
| IgnoreError | Boolean | No | Specifies whether to output error logs when no matching logs are found. Default value: false, which indicates that error logs are not output. |
Convert logs to traces
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | processor_otel_trace | The type of the plugin. Set the value to processor_otel_trace. |
| SourceKey | String | Yes | The name of the original field. | ||
| Format | String | Yes | json | The format after conversion. Valid values: protobuf, json, and protojson. | |
| NoKeyError | Boolean | No | false | true | Specifies whether to report an error if the corresponding original field does not exist in the log. Default value: false. |
| TraceIDNeedDecode | Boolean | No | Specifies whether to perform Base64 decoding on the TraceID. Default value: false. If you set Format to protojson and the TraceID is already Base64-encoded, you must set TraceIDNeedDecode to true. Otherwise, the conversion fails. | ||
| SpanIDNeedDecode | Boolean | No | Specifies whether to perform Base64 decoding on the SpanID. Default value: false. If you set Format to protojson and the SpanID is already Base64-encoded, you must set SpanIDNeedDecode to true. Otherwise, the conversion fails. | ||
| ParentSpanIDNeedDecode | Boolean | No | Specifies whether to perform Base64 decoding on the ParentSpanID. Default value: false. If you set Format to protojson and the ParentSpanID is already Base64-encoded, you must set ParentSpanIDNeedDecode to true. Otherwise, the conversion fails. |
Output plugins.
SLS output plugin
| Parameter | Type | Required | Default value | Example | Description |
| Type | string | Yes | / | flusher_sls | The type of the plugin. Set the value to flusher_sls. |
| Logstore | string | Yes | / | test-logstore | The name of the Logstore. |
Response elements
|
Element |
Type |
Description |
Example |
None defined.
Examples
Success response
JSON format
{}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.