Install
openclaw skills install @huaweiclouddev/huawei-cloud-lts-log-inspectorHuawei Cloud LTS (Log Tank Service) log traffic statistics, log context query, host group and access config inspection, collection status patrol, and OBS transfer management for batch log export. Covers log histogram query, TOP-N traffic statistics, timeline traffic statistics, single-log context retrieval, host group listing, access config query, host collection status inspection, OBS transfer create/list/delete, and diagnostic workflows for traffic surge, collection break, and log flooding. Triggers include: 日志流量异常排查, 日志采集故障巡检, 故障深度定位, 日志批量导出, LTS流量统计, 日志上下文查询, 采集断流, 日志刷屏, log traffic anomaly, collection inspection, log context, LTS patrol, log flooding diagnose, offline log export, OBS transfer.
openclaw skills install @huaweiclouddev/huawei-cloud-lts-log-inspectorThis Skill provides a comprehensive toolkit for Huawei Cloud LTS (Log Tank Service) log traffic analysis, collection health inspection, and batch log export management. It is designed for four primary scenarios:
User Trigger -> Skill Workflow -> hcloud CLI LTS Commands -> Structured Output
|-- Traffic Stats (Histogram / TOP-N / Timeline)
|-- Log Context Query
|-- Collection Inspection (HostGroup / Host / AccessConfig)
|-- OBS Transfer (Create / List / Delete)
+-- Diagnostic Report (Aggregated)
| Feature | Status | Explanation |
|---|---|---|
| Consumer group query (F8) | Unavailable | LTS consumer group is in invitation-only beta; only Java/Go SDK, no REST API or CLI |
| Consumer group cursor update (F11) | Unavailable | Same as above |
| Offline download task (F9/F10/F12) | Alternative | LTS console offline download is whitelist-only with no public API. OBS transfer (CreateTransfer) is used as the alternative. |
references/cli-installation-guide.mdhcloud configure list shows a valid profilereferences/iam-policies.md.cn-north-4).1. ListTopnTrafficStatistics -> Identify TOP-N log streams by write traffic (descending)
2. ListTimeLineTrafficStatistics -> Check traffic trend over the time window
3. ListLogHistogram -> Drill down into the suspect log stream histogram
4. Output: Structured traffic anomaly report
1. ListLogs -> Search for the target log by keyword/time range to get line_num
2. ListLogContext -> Pull context logs (before/after) using line_num
3. Output: Concise context log fragments (max 500 lines each direction)
1. ListHostGroup -> List all host groups
2. ListHost --filter.host_status=offline -> Find offline hosts
3. ListHost --filter.host_status=error -> Find error-state hosts
4. ListAccessConfig -> Check collection configs for affected hosts
5. Output: Collection anomaly checklist
1. [Cost risk warning displayed to user]
2. User confirms
3. CreateTransfer -> Create OBS transfer task (log group + stream -> OBS bucket)
4. ListTransfers -> Monitor transfer status
5. User downloads logs from OBS bucket
6. (Optional) DeleteTransfer -> Clean up transfer after download
hcloud LTS ListLogHistogram --cli-region={region} \
--group_id={log_group_id} \
--stream_id={log_stream_id} \
--start_time={start_time} \
--end_time={end_time} \
--key_word={keyword} \
--step_interval={step_interval}
| Parameter | Required | Description |
|---|---|---|
--group_id | Yes | Log group ID |
--stream_id | Yes | Log stream ID |
--start_time | Yes | Start time |
--end_time | Yes | End time |
--key_word | Yes | Search keyword |
--step_interval | Yes | Step interval (integer) |
hcloud LTS ListTopnTrafficStatistics --cli-region={region} \
--resource_type=log_stream \
--topn=10 \
--start_time={start_timestamp_ms} \
--end_time={end_timestamp_ms} \
--search_list.1=write \
--sort_by=write \
--is_desc=true \
--filter.log_group_id={log_group_id}
| Parameter | Required | Description |
|---|---|---|
--resource_type | Yes | log_group, log_stream, or tenant |
--topn | Yes | Top N, range 1-100 |
--start_time | Yes | Start timestamp (ms), max 30-day range |
--end_time | Yes | End timestamp (ms) |
--search_list.1 | Yes | Data type: index/write/storage/basicTransfer/seniorTransfer/coldStorage |
--sort_by | Yes | Sort field, must be in search_list |
--is_desc | Yes | Descending order: true/false |
--filter.{key} | Yes | Filter conditions (map), e.g., --filter.log_group_id=xxx |
hcloud LTS ListTimeLineTrafficStatistics --cli-region={region} \
--resource_type=log_stream \
--search_type=write \
--start_time={start_timestamp_ms} \
--end_time={end_timestamp_ms} \
--period=1 \
--timezone=Asia/Shanghai \
--resource_id={resource_id}
| Parameter | Required | Description |
|---|---|---|
--resource_type | Yes | log_group, log_stream, or tenant |
--search_type | Yes | write/index/storage/basicTransfer/seniorTransfer |
--start_time | Yes | Start timestamp (ms), max 30-day range |
--end_time | Yes | End timestamp (ms) |
--period | Yes | Time interval in hours, range 1-24 |
--timezone | Yes | Timezone string |
--resource_id | No | Specific resource ID for filtering |
hcloud LTS ListLogs --cli-region={region} \
--log_group_id={log_group_id} \
--log_stream_id={log_stream_id} \
--start_time={start_time_ms} \
--end_time={end_time_ms} \
--keywords={keyword} \
--limit=100 \
--is_desc=true
hcloud LTS ListLogContext --cli-region={region} \
--log_group_id={log_group_id} \
--log_stream_id={log_stream_id} \
--line_num={line_num} \
--backwards_size=100 \
--forwards_size=100
| Parameter | Required | Description |
|---|---|---|
--log_group_id | Yes | Log group ID |
--log_stream_id | Yes | Log stream ID |
--line_num | No | Log line sequence number (nanosecond timestamp), from ListLogs result |
--backwards_size | No | Lines before (context above), range [0, 500], default 100 |
--forwards_size | No | Lines after (context below), range [0, 500], default 100 |
--scroll_id | No | Pagination scroll ID from previous query |
Note: To get
line_num, first callListLogsto search for the target log, then use the returnedline_numvalue inListLogContext.
hcloud LTS ListHostGroup --cli-region={region} \
--filter.host_group_type=linux
| Parameter | Required | Description |
|---|---|---|
--filter.host_group_type | No | windows or linux |
--filter.host_group_name_list.1 | No | Host group name filter |
--host_group_id_list.1 | No | Host group ID filter |
hcloud LTS ListHost --cli-region={region} \
--filter.host_status=offline
| Parameter | Required | Description |
|---|---|---|
--filter.host_status | No | Host status: uninstall, running, offline, error, plugin error, installing, install-fail, upgrading, upgrade-fail, uninstalling, authentication error |
--filter.host_name_list.1 | No | Host name filter |
--filter.host_ip_list.1 | No | Host IP filter |
--host_id_list.1 | No | Host ID filter |
Collection status meanings:
running- Agent running normally, logs being collectedoffline- Host offline, collection brokenerror/plugin error- Agent error, collection may be brokenuninstall- Agent not installedauthentication error- Auth failure, collection broken
hcloud LTS ListAccessConfig --cli-region={region} \
--access_config_name_list.1={config_name}
| Parameter | Required | Description |
|---|---|---|
--access_config_name_list.1 | No | Access config name filter |
--host_group_name_list.1 | No | Host group name filter |
--log_group_name_list.1 | No | Log group name filter |
--log_stream_name_list.1 | No | Log stream name filter |
Cost Risk Warning: Creating an OBS transfer task will incur OBS storage costs and LTS transfer fees based on the actual log transfer volume. Always confirm with the user before creating a transfer task.
hcloud LTS CreateTransfer --cli-region={region} \
--log_group_id={log_group_id} \
--log_streams.1.log_stream_id={log_stream_id} \
--log_transfer_info.log_transfer_type=OBS \
--log_transfer_info.log_transfer_mode=cycle \
--log_transfer_info.log_transfer_status=ENABLE \
--log_transfer_info.log_storage_format=RAW \
--log_transfer_info.log_transfer_detail.obs_bucket_name={obs_bucket} \
--log_transfer_info.log_transfer_detail.obs_period=5 \
--log_transfer_info.log_transfer_detail.obs_period_unit=min
| Parameter | Required | Description |
|---|---|---|
--log_group_id | Yes | Source log group ID |
--log_streams.1.log_stream_id | Yes | Source log stream ID |
--log_transfer_info.log_transfer_type | Yes | OBS, DIS, or DMS |
--log_transfer_info.log_transfer_mode | Yes | cycle (periodic) or realTime |
--log_transfer_info.log_transfer_status | Yes | ENABLE, DISABLE, or EXCEPTION |
--log_transfer_info.log_storage_format | Yes | RAW or JSON |
--log_transfer_info.log_transfer_detail.obs_bucket_name | Yes | Target OBS bucket name |
--log_transfer_info.log_transfer_detail.obs_period | Yes | Transfer period: 1,2,3,5,6,12,30 |
--log_transfer_info.log_transfer_detail.obs_period_unit | Yes | min or hour |
hcloud LTS ListTransfers --cli-region={region} \
--log_transfer_type=OBS
hcloud LTS DeleteTransfer --cli-region={region} \
--log_transfer_id={transfer_id}
# Step 1: TOP-N by write traffic (descending)
hcloud LTS ListTopnTrafficStatistics --cli-region={region} \
--resource_type=log_stream --topn=10 \
--start_time={start_ms} --end_time={end_ms} \
--search_list.1=write --sort_by=write --is_desc=true
# Step 2: Timeline trend for the top log stream
hcloud LTS ListTimeLineTrafficStatistics --cli-region={region} \
--resource_type=log_stream --search_type=write \
--start_time={start_ms} --end_time={end_ms} \
--period=1 --timezone=Asia/Shanghai \
--resource_id={top_stream_id}
# Step 1: Find offline hosts
hcloud LTS ListHost --cli-region={region} --filter.host_status=offline
# Step 2: Find error-state hosts
hcloud LTS ListHost --cli-region={region} --filter.host_status=error
# Step 3: Check access configs
hcloud LTS ListAccessConfig --cli-region={region}
# TOP-N by write traffic descending to find flooding log stream
hcloud LTS ListTopnTrafficStatistics --cli-region={region} \
--resource_type=log_stream --topn=5 \
--start_time={start_ms} --end_time={end_ms} \
--search_list.1=write --sort_by=write --is_desc=true
The full patrol report aggregates all inspection results:
# 1. TOP-N traffic
hcloud LTS ListTopnTrafficStatistics --cli-region={region} \
--resource_type=log_stream --topn=10 \
--start_time={start_ms} --end_time={end_ms} \
--search_list.1=write --sort_by=write --is_desc=true
# 2. Timeline traffic
hcloud LTS ListTimeLineTrafficStatistics --cli-region={region} \
--resource_type=tenant --search_type=write \
--start_time={start_ms} --end_time={end_ms} \
--period=1 --timezone=Asia/Shanghai
# 3. Host groups
hcloud LTS ListHostGroup --cli-region={region}
# 4. Abnormal hosts
hcloud LTS ListHost --cli-region={region} --filter.host_status=offline
hcloud LTS ListHost --cli-region={region} --filter.host_status=error
# 5. Access configs
hcloud LTS ListAccessConfig --cli-region={region}
Output a structured report with:
| Parameter | Required | Description | Example |
|---|---|---|---|
{region} | Yes | Huawei Cloud region | cn-north-4 |
{log_group_id} | Yes | LTS log group ID | xxxx-xxxx-xxxx |
{log_stream_id} | Yes | LTS log stream ID | xxxx-xxxx-xxxx |
{start_time} / {end_time} | Yes | Time range (format depends on command) | 1704067200000 (ms timestamp) |
{topn} | No | TOP-N count, range 1-100 | 10 |
{line_num} | Yes (context) | Log line sequence number | from ListLogs result |
{obs_bucket} | Yes (transfer) | Target OBS bucket name | my-log-backup |
{keyword} | No | Search keyword for log query | error |
hcloud LTS <Operation> --cli-region=<region> [--key=value ...]
| Feature | Description | Example |
|---|---|---|
| Service name | LTS (uppercase) | hcloud LTS ListHostGroup |
| Operation name | PascalCase | ListTopnTrafficStatistics |
| Region parameter | --cli-region=<value> | --cli-region=cn-north-4 |
| Simple parameter | --key=value | --topn=10 |
| Indexed parameter | --key.1=value1 | --search_list.1=write |
references/cli-installation-guide.md - hcloud CLI installation and configurationreferences/iam-policies.md - Least-privilege IAM policies for LTSreferences/verification-method.md - Verification and testing methodsreferences/dataflow-diagram.md - Mermaid data flow diagramreferences/acceptance-criteria.md - Acceptance criteriareferences/lts-api-reference.md - LTS API command quick reference