cls-query

Query and analyze Tencent Cloud CLS logs via SearchLog API.

6|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/slowman2084/meta-agent --skill cls-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cls-query
Source: https://github.com/slowman2084/meta-agent/tree/main/source/skills/cls-query
Command: npx skills add https://github.com/slowman2084/meta-agent --skill cls-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill makes it easy to search, filter, and analyze logs stored in Tencent Cloud CLS so engineers can troubleshoot issues, investigate incidents, and produce aggregated metrics without manually crafting signed API requests.

Core Features & Use Cases

  • Search & Retrieval: Run raw or structured searches using CQL or Lucene against a specific TopicId and retrieve paginated results.
  • SQL-style Analysis: Support SELECT-style aggregations for counts, group-bys, histograms and approximate distinct (HyperLogLog).
  • Flexible Configuration: Load credentials and endpoint from CLI arguments, environment variables, or a .env file with a clear precedence.
  • Use Cases: Investigate error spikes, compute status-code distributions, count unique instance_ids, and export query results for reporting.

Quick Start

Use cls-query to search a TopicId for error logs between two millisecond timestamps using your configured CLS credentials.

Frequently Asked Questions about cls-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Tencent Cloud CLS logs using Python?

Query Tencent Cloud CLS logs by executing CQL or Lucene syntax against a specific TopicId via the SearchLog API. The tool automatically handles TC3-HMAC-SHA256 signing and returns paginated, structured JSON log records.

Can I run SQL-style aggregations on CLS logs?

Yes, you can run SQL-style aggregations on CLS logs to compute counts, group-bys, histograms, and approximate distinct counts using HyperLogLog. This allows you to produce aggregated metrics directly from your log data.

How do I configure Tencent Cloud credentials for log analysis?

Configure Tencent Cloud credentials for log analysis by providing them via CLI arguments, environment variables, or a .env file. The system respects a clear precedence order to authenticate your SearchLog API requests.

Does this tool support bulk export and highlighting for CLS log search?

Yes, the tool supports bulk export and highlighting for CLS log search. You can retrieve paginated results, highlight matching terms, and export the queried log records for incident troubleshooting and reporting.

What is the best way to investigate error spikes in Tencent Cloud CLS?

The best way to investigate error spikes in Tencent Cloud CLS is to run structured CQL queries filtered by specific millisecond timestamps. This retrieves targeted error logs and computes status-code distributions for troubleshooting.