Ingesting ServiceStage Containerized Application Logs to LTS
LTS collects log data from containerized applications of ServiceStage. By processing a massive number of logs efficiently, securely, and in real time, LTS provides useful insights for you to optimize the availability and performance of cloud services and applications. It also helps you efficiently perform real-time decision-making, device O&M management, and service trend analysis.
Perform the following steps to complete the ingestion configuration:
- Step 1: Select a Log Stream
- Step 2: Check Dependencies
- Step 3: (Optional) Select a Host Group
- Step 4: Configure the Collection
- Step 5: Configure Indexing
- Step 6: Complete the Ingestion Configuration
To collect logs from multiple scenarios, set multiple ingestion configurations in a batch.
Currently, this function is available only to whitelisted users. To use it, submit a service ticket.
Prerequisites
- ICAgent has been installed and added to the host group.
- A ServiceStage application has been created. For details, see Creating an Application.
- A ServiceStage environment has been created. For details, see Creating an Environment.
- A ServiceStage component has been created. For details, see Creating and Deploying a Component.
- You have enabled ICAgent Diagnosis to view exceptions, overall status, and collection status of ICAgent. For details, see Setting ICAgent Collection.
Restrictions
- CCE cluster nodes whose container engine is Docker are supported.
- CCE cluster nodes whose container engine is Containerd are supported. You must be using ICAgent 5.12.130 or later.
- To collect container log directories mounted to host directories to LTS, you must configure the node file path.
- Restrictions on the Docker storage driver: Currently, container file log collection supports only the overlay2 storage driver. devicemapper cannot be used as the storage driver. Run the following command to check the storage driver type:
docker info | grep "Storage Driver"
Step 1: Select a Log Stream
- Log in to the LTS console.
- Choose Log Ingestion > Ingestion Center in the navigation pane. Then, click ServiceStage - Containerized Application Logs under Self-Built software.
Alternatively, choose Log Ingestion > Ingestion Management in the navigation pane, and click Ingest Log > ServiceStage - Containerized Application Logs.
Alternatively, choose Log Management in the navigation pane and click the target log stream to access its details page. Click in the upper right corner. On the displayed page, click the Log Ingestion tab and click Ingest Log. In the displayed dialog box, click ServiceStage - Containerized Application Logs under Self-Built software.
- In the Select Log Stream step, set the following parameters:
- Select a ServiceStage application and ServiceStage environment.
- Select a log group from the Log Group drop-down list. If there are no desired log groups, click Create Log Group to create one.
- Select a log stream from the Log Stream drop-down list. If there are no desired log streams, click Create Log Stream to create one.
- Click Next: Check Dependencies.
Step 2: Check Dependencies
- The system automatically checks whether there is a host group with the custom identifier k8s-log-Application ID.
If not, click Auto Correct.
- Auto Correct: Configure dependencies with one click.
- Check Again: Recheck dependencies.
- Click Next: (Optional) Select Host Group.
Step 3: (Optional) Select a Host Group
- In the host group list, the host group to which the cluster belongs is selected by default. You can also select host groups as required.
- Click Next: Configurations.
Step 4: Configure the Collection
When you configure ServiceStage containerized application log ingestion, the collection configuration details are as follows.
- Collection Configuration Name: Enter 1 to 64 characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. Do not start with a period or underscore, or end with a period.
- Data Source: Select a data source type and configure it. The following data source types are supported: container standard output, container file path, node file path, and K8s event.
Table 1 Collection configuration parameters Type
Description
Container standard output
Collects stderr and stdout logs of a specified container in the cluster. Either Container Standard Output (stdout) or Container Standard Error (stderr) must be enabled.
- If you enable Container Standard Error (stderr), select your collection destination path: Collect standard output and standard error to different files (stdout.log and stderr.log) or Collect standard output and standard error to the same file (stdout.log).
- The standard output of the matched container is collected to the specified log stream. Standard output to AOM stops.
- Allow Repeated File Collection (not available to Windows)
After you enable this function, one host log file can be collected to multiple log streams. This function is available only to certain ICAgent versions. For details, see Checking the ICAgent Version Description.
After you disable this function, each collection path must be unique. That is, the same log file in the same host cannot be collected to different log streams.
Container file
Collects file logs of a specified container in the cluster.
- Collection Paths: Add one or more host paths. LTS will collect logs from these paths.
NOTE:
If a container mount path has been configured for the CCE cluster workload, the paths added for this field are invalid. The collection paths take effect only after the mount path is deleted.
- Allow Repeated File Collection (not available to Windows)
After you enable this function, one host log file can be collected to multiple log streams. This function is available only to certain ICAgent versions. For details, see Checking the ICAgent Version Description.
After you disable this function, each collection path must be unique. That is, the same log file in the same host cannot be collected to different log streams.
- Set Collection Filters: Blacklisted directories or files will not be collected. If you specify a directory, all files in the directory are filtered out.
Node file
Collects files of a specified node in a cluster.
- Collection Paths: Add one or more host paths. LTS will collect logs from these paths.
- Allow Repeated File Collection (not available to Windows)
After you enable this function, one host log file can be collected to multiple log streams. This function is available only to certain ICAgent versions. For details, see Checking the ICAgent Version Description.
After you disable this function, each collection path must be unique. That is, the same log file in the same host cannot be collected to different log streams.
- Set Collection Filters: Blacklisted directories or files will not be collected. If you specify a directory, all files in the directory are filtered out.
Kubernetes event
Collects event logs of the Kubernetes cluster. You do not need to set parameters. Only ICAgent 5.12.150 or later is supported.
NOTE:Kubernetes events of a Kubernetes cluster can be collected to only one log stream.
- If you select Container standard output or Container file as the data source type, set the ServiceStage matching rule by selecting the corresponding component from the drop-down list.
- Enable structuring parsing. For details, see Setting ICAgent Structuring Parsing Rules.
LTS enables combined parsing, allowing you to create different structuring parsing rules for each collection configuration of a log stream.
If you have configured cloud structuring parsing, delete its configurations before configuring ICAgent structuring parsing.
Figure 1 ICAgent structuring parsing configuration
- Set other configurations.
- Configure the log format and time by referring to Table 3.
Table 3 Log collection settings Parameter
Description
Log Format
- Single-line: Each log line is displayed as a single log event.
- Multi-line: Multiple lines of exception log events can be displayed as a single log event. This is helpful when you check logs to locate problems.
Log Time
System time: log collection time by default. It is displayed at the beginning of each log event.
NOTE:- Log collection time is the time when logs are collected and sent by ICAgent to LTS.
- Log printing time is the time when logs are printed. ICAgent collects and sends logs to LTS with an interval of 1 second.
- Restriction on log collection time: Logs are collected within 24 hours before and after the system time.
Time wildcard: You can set a time wildcard so that ICAgent will look for the log printing time as the beginning of a log event.
- If the time format in a log event is 2019-01-01 23:59:59.011, the time wildcard should be set to YYYY-MM-DD hh:mm:ss.SSS.
- If the time format in a log event is 19-1-1 23:59:59.011, the time wildcard should be set to YY-M-D hh:mm:ss.SSS.
NOTE:If a log event does not contain year information, ICAgent regards it as printed in the current year.
Example:
YY - year (19) YYYY - year (2019) M - month (1) MM - month (01) D - day (1) DD - day (01) hh - hours (23) mm - minutes (59) ss - seconds (59) SSS - millisecond (999) hpm - hours (03PM) h:mmpm - hours:minutes (03:04PM) h:mm:sspm - hours:minutes:seconds (03:04:05PM) hh:mm:ss ZZZZ (16:05:06 +0100) hh:mm:ss ZZZ (16:05:06 CET) hh:mm:ss ZZ (16:05:06 +01:00)
Log Segmentation
This parameter needs to be specified if the Log Format is set to Multi-line. By generation time indicates that a time wildcard is used to detect log boundaries, whereas By regular expression indicates that a regular expression is used.
By regular expression
You can set a regular expression to look for a specific pattern to indicate the beginning of a log event. This parameter needs to be specified when you select Multi-line for Log Format and By regular expression for Log Segmentation.
- Click Next: Index Settings.
Step 5: Configure Indexing
- (Optional) Configure indexing. For details, see Setting Indexes.
- Click Submit.
Step 6: Complete the Ingestion Configuration
- Click its name to view its details.
- Click Modify in the Operation column to modify the ingestion configuration.
- Click Configure Tag in the Operation column to add a tag.
- Click More > Copy in the Operation column to copy the ingestion configuration.
- Click More > Delete in the Operation column to delete the ingestion configuration.
Deleting an ingestion configuration may lead to log collection failures, potentially resulting in service exceptions related to user logs. In addition, the deleted ingestion configuration cannot be restored. Exercise caution when performing this operation.
- To stop log collection of an ingestion configuration, toggle off in the Status column to disable the configuration. To restart log collection, toggle on in the Status column.
Disabling an ingestion configuration may lead to log collection failures, potentially resulting in service exceptions related to user logs. Exercise caution when performing this operation.
- Click More > ICAgent Collect Diagnosis in the Operation column of the ingestion configuration to monitor the exceptions, overall status, and collection status of ICAgent.
Setting Multiple Ingestion Configurations in a Batch
You can set multiple ingestion configurations for multiple scenarios in a batch, avoiding repetitive setups.
- On the Ingestion Management page, click Batch Ingest to go to the details page. For details, see Table 4.
Table 4 Adding configurations in batches Type
Operation
Description
Basic Settings
Ingestion Type
Select ServiceStage - Containerized Application Logs.
Configurations to Add
Enter the number of ingestion configurations in the text box and click Add.
A maximum of 100 ingestion configurations can be added, including the one already exists under Ingestion Settings by default. Therefore, you can add up to 99 more.
Ingestion Settings
Configuration List
- The ingestion configurations are displayed on the left. You can add up to 99 more configurations.
- The ingestion configuration details are displayed on the right. Set them by referring to Step 4: Configure the Collection.
- After an ingestion configuration is complete, you can click Apply to Other Configurations to copy its settings to other configurations.
- Click Check Parameters. After the check is successful, click Submit.
The added ingestion configurations will be displayed on the Ingestion Management page after the batch creation is successful.
- (Optional) Perform the following operations on ingestion configurations:
- Select multiple existing ingestion configurations and click Edit. On the displayed page, select an ingestion type to modify the corresponding ingestion configurations.
- Select multiple existing ingestion configurations and click Enable or Disable. If you toggle off the switch in the Status column of an ingestion configuration, logs will not be collected for this configuration.
- Select multiple existing ingestion configurations and click Delete.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot