Skip to content

Collector "Huawei Cloud-LTS" Configuration Manual

Before reading this article, please read:

Before using this collector, you must install the 'Integration Core Package' and its associated third-party dependency packages

1. Configuration Structure

The configuration structure of this collector is as follows:

Field Type Required Description
region_id str Required Region ID such as: 'cn-north-1'
project_id str Required Represents the project ID to be collected under the region
targets list Not required LTS collection object configuration list
targets[#].log_group_id str Not required The required LTS log group ID
targets[#].log_streams list Not required The required LTS log stream ID list

2. Configuration Examples

Collecting all log groups and log streams log events

Collect all log streams under all log groups

Python
1
2
3
4
5
6
collector_configs = [
    {
        'region_id': 'cn-north-4',
        'project_id':'c631xxxx',
    }
]

Collecting all log streams

Collect all log streams under the log group 586e17ad-xxxx

Python
1
2
3
4
5
6
7
8
9
collector_configs = [
    {
        'region_id': 'cn-north-4',
        'project_id':'c631xxxx',
        'targets': [
            {'log_group_id': '586e17ad-xxxx'},
        ]
    }
]

Specifying specific log streams

Collect the log stream with ID 3253bb3d-xxxx in 586e17ad-xxxx

Python
1
2
3
4
5
6
7
8
9
collector_configs = [
    {
        'region_id': 'cn-north-4',
        'project_id':'c631xxxx',
        'targets': [
            {'log_group_id': '586e17ad-xxxx' ,'log_streams':['3253bb3d-xxxx']},
        ]
    }
]

3. Data Reporting Format

After data synchronization, you can view the data in the "LOG" section of TrueWatch.

For example, consider the following collector configuration:

Python
1
2
3
4
5
6
7
8
9
collector_configs = [
    {
        'region_id': 'cn-north-4',
        'project_id':'c631xxxx',
        'targets': [
            {'log_group_id': '586e17ad-xxxx' ,'log_streams':['3253bb3d-xxxx']},
        ]
    }
]

An example of the reported data is as follows:

JSON
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "measurement": "huaweicloud_lts_586e17ad-xxxx",
  "tags": {
    "RegionId": "cn-north-4",
    "log_group_id": "586e17ad-xxxx",
    "log_stream_id": "3253bb3d-xxxx"
  },
  "fields": {
    "content": "{\"severity\":\"NOTE\",\"log_type\":\"error_log\"}",
    "labels": "{\"_resource_id\": \"DBS_LOG\", \"_resource_name\": \"DBS_LOG\"}"
  }
}

X. Appendix

Huawei Cloud LTS "Region ID"

Please refer to the official Huawei Cloud documentation: