clscli
Query and analyze Tencent Cloud CLS logs
Why use this skill?
Use the clscli skill to query, search, and analyze Tencent Cloud Log Service (CLS) logs. Perform SQL analysis and export data directly from your terminal.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/dbwang0130/clscliWhat This Skill Does
The clscli skill provides a command-line interface for the Tencent Cloud Log Service (CLS). It allows users to interact with their cloud infrastructure logs directly from the terminal or through an AI agent. You can perform complex log analysis using CQL or SQL, search for errors, monitor application performance, and audit cloud events efficiently. It abstracts the complexity of the Tencent Cloud API, enabling you to list log topics, query specific log entries, and export log data to various formats like JSON or CSV for further analysis.
Installation
To integrate this skill, follow these steps:
- Ensure you have Homebrew installed, then run:
brew tap dbwang0130/clscli && brew install dbwang0130/clscli/clscli - Acquire your Tencent Cloud API credentials (Secret ID and Secret Key) from the Tencent Cloud Console.
- Set your credentials as environment variables in your terminal profile:
export TENCENTCLOUD_SECRET_ID="your-secret-id"export TENCENTCLOUD_SECRET_KEY="your-secret-key" - Install the skill into your OpenClaw environment using:
clawhub install openclaw/skills/skills/dbwang0130/clscli
Use Cases
- Incident Response: Quickly grep error logs across multiple services during an outage to identify root causes.
- Operational Monitoring: Extract metrics from log data using SQL aggregation to track request latency or error rates over the last hour.
- Audit Compliance: Export security logs or access logs to CSV for regular compliance reporting and review.
- Development Debugging: Filter logs for a specific User ID or Request ID to trace user journeys through your application backend.
Example Prompts
- "List all log topics in the ap-guangzhou region to see what data sources I have available."
- "Search for all logs with level:ERROR in topic 'app-logs' for the last 30 minutes and output as JSON."
- "Calculate the count of requests grouped by status code for the last hour using SQL in the 'web-server' log topic."
Tips & Limitations
- Pre-check: Always use
clscli topicsfirst if you are unsure of the log topic ID or region name to avoid failed queries. - Syntax: Prefer the CLS Query Language (CQL) for general log searches as it is optimized for speed and readability compared to Lucene.
- Performance: When running large queries, use the
--maxflag to prevent excessive API consumption and ensure your terminal doesn't get flooded with results; it will handle pagination automatically. - Security: Never hardcode your API keys in scripts; always use environment variables or secure vault integrations to manage access.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-dbwang0130-clscli": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: external-api, file-write