Config Name |
Enter a name for the Logtail configuration. The name must be unique in a project.
After the Logtail configuration is created, you cannot change the name of the Logtail
configuration.
You can click Import Other Configuration to import a Logtail configuration from another project.
|
Log Path |
Specify the log file directory and log file name.
You can specify an exact directory and an exact name. You can also use wildcard characters
to specify the directory and name. For more information, see Wildcard matching. Log Service scans all levels of the specified directory for the log files that match
specified conditions. Examples:
- If you specify /apsara/nuwa/**/*.log, Log Service collects logs from the log files whose names are suffixed by .log in the /apsara/nuwa directory and the recursive subdirectories of the directory.
- If you specify /var/logs/app_*/*.log, Log Service collects logs from the log files that meet the following conditions:
The file name contains .log. The file is stored in a subdirectory under the /var/logs directory or in a recursive subdirectory of the subdirectory. The name of the subdirectory
matches the app_* pattern.
|
Blacklist |
If you turn on Blacklist, you must configure a blacklist to specify the directories or files that you want
Log Service to skip when it collects logs. You can specify exact directories and file
names. You can also use wildcards to specify directories and file names. Examples:
- If you select Filter by Directory from a drop-down list in the Filter Type column and enter /home/admin/dir1 for Content, all files in the /home/admin/dir1 directory are skipped.
- If you select Filter by Directory from a drop-down list in the Filter Type column and enter /home/admin/dir* for Content, the files in all subdirectories whose names are prefixed by dir in the
/home/admin/ directory are skipped.
- If you select Filter by Directory from a drop-down list in the Filter Type column and enter /home/admin/*/dir for Content, all files in dir directories in each subdirectory of the /home/admin/ directory are skipped.
For example, the files in the /home/admin/a/dir directory are skipped, but the files in the /home/admin/a/b/dir directory are not skipped.
- If you select Filter by File from a drop-down list in the Filter Type column and enter /home/admin/private*.log for Content, all files whose names are prefixed by private and suffixed by .log in
the /home/admin/ directory are skipped.
- If you select Filter by File from a drop-down list in the Filter Type column and enter /home/admin/private*/*_inner.log for Content, all files whose names are suffixed by _inner.log in the subdirectories
whose names are prefixed by private in the /home/admin/ directory are skipped.
For example, the /home/admin/private/app_inner.log file is skipped, but the /home/admin/private/app.log file is not skipped.
Note
- When you configure this parameter, you can use only asterisks (*) or question marks
(?) as wildcard characters.
- If you use wildcard characters to configure Log Path and you want to skip some directories in the specified directory, you must configure
the blacklist and enter a complete directory.
For example, if you set Log Path to /home/admin/app*/log/*.log and you want to skip all subdirectories in the /home/admin/app1* directory, you must select Filter by Directory and enter /home/admin/app1*/** to configure the blacklist. If you enter /home/admin/app1*, the blacklist does not take effect.
- When a blacklist is in use, computational overhead is generated. We recommend that
you add up to 10 entries to the blacklist.
|
Docker File |
If you want to collect logs from Docker containers, you must turn on Docker File and specify the directories and tags of the containers. Logtail monitors the containers
to check whether the containers are created or destroyed. Then, Logtail filters the
logs of the containers based on tags and collects the logs that meet the filter conditions.
For more information about how to collect the text logs of containers, see Use the Log Service console to collect container text logs in DaemonSet mode.
|
Mode |
Select the log collection mode. By default, NGINX Configuration Mode is displayed. You can change the mode.
|
NGINX Log Configuration |
Enter the log configuration section that is specified in the NGINX configuration file.
The section starts with log_format. Example: log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$request_time $request_length '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent"';
For more information, see Additional information: Log formats and sample logs.
|
Regular Expression |
Log Service generates a regular expression based on the content that you enter in
NGINX Log Configuration.
|
Log Sample |
Enter a sample NGINX log that is collected from an actual scenario. Example:192.168.1.2 - - [10/Jul/2020:15:51:09 +0800] "GET /ubuntu.iso HTTP/1.0" 0.000 129 404 168 "-" "Wget/1.11.4 Red Hat modified"
Log Service uses the sample log to check whether the content of NGINX Log Configuration matches the generated regular expression. After you enter the sample log, click Verify. If the verification is successful, Log Service automatically extracts the values
for NGINX Key from the sample log.
|
NGINX Key |
The NGINX keys and values are automatically generated based on the content of NGINX
Log Configuration and Log Sample.
|
Drop Failed to Parse Logs |
- If you turn on Drop Failed to Parse Logs, the logs that fail to be parsed are not uploaded to Log Service.
- If you turn off Drop Failed to Parse Logs, the logs that fail to be parsed are still uploaded to Log Service as the value of
the __raw_log__ field.
|
Maximum Directory Monitoring Depth |
Specify the maximum number of levels of subdirectories that you want to monitor. The
subdirectories are in the log file directory that you specify. Valid values: 0 to
1000. The value 0 indicates that only the specified log file directory is monitored.
|