agentCLAWHUBUnverified

Alibabacloud Sls Query

Alibaba Cloud SLS (Simple Log Service) log query & analysis skill. Use this skill to help users write, explain, optimize, execute, or troubleshoot SLS index...

OpenClaw

Rank

62

Safety

84

Downloads

1.2k

Updated

Oct 11, 2026

Version

0.0.2

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 11, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 11, 2026
Adoption signal
1.2K downloadsadoption · observed Oct 11, 2026
Latest release
0.0.2release · observed Jun 29, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-sls-query
  1. Install using `clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-sls-query` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/sdk-team/alibabacloud-sls-query before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-sls-query/snapshot"

Documentation

CLAWHUB

153,924 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: alibabacloud-sls-query
description: |
  Alibaba Cloud SLS (Simple Log Service) log query & analysis skill. Use this skill to help users write, explain, optimize, execute, or troubleshoot SLS index search, SQL analytics, and SPL scan/pipeline statements through the aliyun CLI.
  Triggers: "SLS 查询", "SLS 分析", "日志查询", "日志分析", "log query", "analyze sls logs", "aliyun log query".
---

# Alibaba Cloud SLS Query & Analysis

## Scenario Description

Use this skill when the user wants to:

- Explain, rewrite, optimize or execute an existing query
- Translate a natural-language requirement into an SLS **index query**, **SQL**, or **SPL** statement

---

## Prerequisites

### Install Aliyun CLI

Run `aliyun version` to verify if version >= `3.3.8`. If not installed or outdated, follow the doc [references/cli-installation-guide.md](references/cli-installation-guide.md) to install or update.

### Update Plugins

```bash
aliyun plugin update
```

### Check Alibaba Cloud credentials configured

Run `aliyun configure list` to check if credentials configured.
If no valid profile is shown, **STOP** here and ask the user to run `aliyun configure` outside of this session.

**Security rules:**

- **NEVER** read, echo, or print AK/SK values
- **NEVER** ask the user to paste AK/SK into the conversation
- **ONLY** use `aliyun configure list` to check credential status

---

## RAM Permission Requirements

| API | CLI | Action | Purpose |
|-----|-----|--------|---------|
| GetLogsV2 | `get-logs-v2` | `log:GetLogStoreLogs` | Run query / SQL / SPL and read results |
| GetIndex  | `get-index`   | `log:GetIndex`        | Read index config to verify prerequisites |

For the minimum and complete RAM policy JSON, see [references/ram-policies.md](references/ram-policies.md).

> **Permission failure handling:** If a call returns `Unauthorized` permission error, stop and surface [references/ram-policies.md](references/ram-policies.md) to the user. Do **not** retry with a different account without explicit user confirmation.

---

## Observability (MUST follow for every aliyun api command)

Upon loading this skill, generate a random session ID (32-char lowercase hex string) once for the entire session. Use it as `{session-id}` below.

**Rule:** Every `aliyun` CLI command that calls a cloud API **MUST** include the `--user-agent` flag. Local utility commands (e.g. `configure`, `plugin`, `version`) do not support this flag and should be excluded.

```
--user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sls-query/{session-id}"
```

Example (assuming session-id is `a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6`):

```bash
aliyun sls get-logs-v2 --project my-project --logstore my-logstore \
  --from 1740000000 --to 1740003600 --query '*' \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sls-query/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
```

Do not skip, alter the format, or omit `--user-agent` on any `aliyun` API command invocation.

---

## Core Workflow

1. Read index configuration (Ge

references/functions/README.md

# SLS Function Reference

This directory contains all functions supported by SLS SQL and SPL analysis statements, organized by category.

## Directory Structure

| File | Category | Description | Supported In |
|------|----------|-------------|--------------|
| `aggregate.yaml` | Aggregate Functions | count, sum, avg, max, min and other statistical functions | SQL |
| `string.yaml` | String Functions | Text concatenation, substring, case conversion, find & replace | SQL + SPL |
| `regex.yaml` | Regex Functions | Regex match, extract, replace | SQL + SPL |
| `datetime.yaml` | Date/Time Functions | Time formatting, parsing, truncation, conversion | SQL + SPL |
| `type_conversion.yaml` | Type Conversion Functions | cast, try_cast type conversion | SQL + SPL |
| `conditional.yaml` | Conditional Functions | if, case, coalesce conditional logic | SQL + SPL |
| `json.yaml` | JSON Functions | JSON data extraction and parsing | SQL + SPL |
| `math.yaml` | Math Functions | Numeric calculations, rounding, exponentiation | SQL + SPL |
| `url.yaml` | URL Functions | URL parsing and parameter extraction | SQL + SPL |
| `ip_geo.yaml` | IP Geolocation Functions | IP to province, city, country, coordinates | SPL only |
| `encoding.yaml` | Encoding/Decoding Functions | URL, Base64 encoding and decoding | SQL + SPL |
| `hash.yaml` | Hash Functions | MD5, SHA1, SHA256 hash computation | SQL + SPL |

## Usage

### 1. Finding Functions

- **By category**: Select the corresponding file from the table above
- **By name**: Search for the specific function in the relevant YAML file
- **By scenario**: Refer to `overview.yaml` for common scenario examples

### 2. Function Details

Each YAML file contains the following structure:

```yaml
functions:
  - name: function_name
    syntax: function_syntax
    description: what_it_does
    examples:
      sql: SQL example
      spl: SPL example
    note: caveats (optional)
```

### 3. Important Notes

#### Type Conversion
- Fields default to VARCHAR type
- Always use `cast()` or `try_cast()` before numeric comparison or arithmetic
- Pay special attention to type conversion in SPL

Example:
```sql
-- Correct
* | SELECT * WHERE cast(status as BIGINT) >= 500

-- Wrong
* | SELECT * WHERE status >= 500
```

#### SQL vs SPL
- **SQL**: uses SELECT, WHERE, GROUP BY syntax
- **SPL**: uses extend, where, stats syntax
- **Aggregate functions** are primarily used in SQL
- **IP geo functions** are SPL only

#### Regular Expressions
- SPL uses the RE2 regex engine
- Not supported: back-references (\1), lookaround (?<=...), etc.
- No double-escaping needed: `\d` is written as `\d`

## Quick Examples

### Statistical Analysis
```sql
-- Count by status code
* | SELECT status, count(*) AS pv GROUP BY status ORDER BY pv DESC
```

### Time Grouping
```sql
-- Hourly aggregation
* | SELECT date_trunc('hour', __time__) AS hour, count(*) AS pv GROUP BY hour
```

### Regex Extraction
```sql
-- Extract error codes
* | SELECT regexp_extract(message, 'code:(

_meta.json

{
  "ownerId": "kn74p5w8ywv6prh40g0s82gmqh83nw54",
  "slug": "alibabacloud-sls-query",
  "version": "0.0.2",
  "publishedAt": 1782698404266
}

references/acceptance-criteria.md

# Acceptance Criteria: sls-query-analysis

**Scenario**: SLS Log Query & Analysis
**Purpose**: Skill testing acceptance criteria

---

## Correct CLI Invocation Patterns

### 1. Command Format — verify product and API name

#### CORRECT

```bash
aliyun sls get-logs-v2 \
  --project my-project \
  --logstore my-logstore \
  --from 1740000000 \
  --to 1740003600 \
  --query '* and status: "500"' \
  --line 100
```

#### INCORRECT — Wrong product name

```bash
aliyun log get-logs-v2 --project my-project --logstore my-logstore
```

**Why**: Product name is `sls`, not `log`, `logservice`, `aliyunlog`, or `aliyun-sls`.

### 2. Parameter Format

#### CORRECT — Kebab-case CLI sub-command and flags

```bash
aliyun sls get-logs-v2 \
  --project my-project \
  --logstore my-logstore \
  --from 1740000000 \
  --to 1740003600 \
  --query '* | select count(*) as total from log' \
  --line 100 \
  --offset 0 \
  --reverse true
```

#### INCORRECT — PascalCase sub-command or flags

```bash
# Sub-command in PascalCase
aliyun sls GetLogsV2 --project my-project --logstore my-logstore
aliyun sls GetIndex  --project my-project --logstore my-logstore

# Flags in PascalCase
aliyun sls get-logs-v2 --Project my-project --Logstore my-logstore --From 1740000000 --To 1740003600
```

**Why**: The SLS plugin uses **kebab-case** for both sub-commands (`get-logs-v2`, `get-index`) and flags (`--project`, `--logstore`, `--from`, `--to`, `--query`).

#### INCORRECT — Using `--region-id` instead of `--region`

```bash
aliyun sls get-logs-v2 --region-id cn-hangzhou --project p --logstore l --from 1 --to 2
```

**Why**: The CLI global flag is `--region`, not `--region-id`.

#### INCORRECT — JSON `--params` string (old SDK pattern)

```bash
aliyun sls get-logs-v2 --params '{"Project":"my-project","Logstore":"my-logstore","From":"1740000000","To":"1740003600"}'
```

**Why**: The CLI takes individual flags, not a JSON `--params` blob.

### 3. Authentication — never expose credentials

#### CORRECT — Verify credential profile via default credential chain

```bash
aliyun configure list
```

#### INCORRECT — Passing AK/SK directly in the command

```bash
aliyun sls get-logs-v2 \
  --access-key-id LTAI5tXXXX \
  --access-key-secret 8dXXXX \
  --project p --logstore l --from 1740000000 --to 1740003600
```

**Why**: Credentials must come from the configured profile, environment variables, STS, or RAM role — never be typed into the command line.

#### INCORRECT — Reading or printing raw credentials

```bash
aliyun configure get           # FORBIDDEN: may expose credential details
cat ~/.aliyun/config.json      # FORBIDDEN: may expose credential details
```

#### INCORRECT — Any command that prints environment credentials

```bash
echo $ALIBABA_CLOUD_ACCESS_KEY_ID       # FORBIDDEN: example of secret output
printenv | grep -i credential           # FORBIDDEN: may reveal secrets
env | grep -i access_key                # FORBIDDEN: may reveal secrets
```

### 4. API Names — verify exact sub-comma

references/cli-installation-guide.md

# Aliyun CLI Installation & Configuration Guide

Complete guide for installing and configuring Aliyun CLI.

> **Aliyun CLI 3.3.8+**: Supports installing and using all published Alibaba Cloud product plugins. Make sure to upgrade to 3.3.8 or later for full plugin ecosystem coverage.

## Installation

### macOS or linux

```bash
/bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"

# Verify
aliyun version
```

### Windows

**Using Binary**

1. Download from: <https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip>
2. Extract the ZIP file
3. Add the directory to your PATH environment variable
4. Open new Command Prompt or PowerShell
5. Verify: `aliyun version`

**Using PowerShell**

```powershell
# Download
Invoke-WebRequest -Uri "https://aliyuncli.alicdn.com/aliyun-cli-windows-latest-amd64.zip" -OutFile "aliyun-cli.zip"

# Extract
Expand-Archive -Path aliyun-cli.zip -DestinationPath C:\aliyun-cli

# Add to PATH (requires admin privileges)
$env:Path += ";C:\aliyun-cli"
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)

# Verify
aliyun version
```

## Configuration

### Quick Start

```bash
aliyun configure set \
  --mode AK \
  --access-key-id <your-access-key-id> \
  --access-key-secret <your-access-key-secret> \
  --region cn-hangzhou
```

All `aliyun configure` commands support non-interactive flags, which is the recommended approach —
it works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts.

**Where to Get Access Keys**

1. Log in to Aliyun Console: <https://ram.console.aliyun.com/>
2. Navigate to: AccessKey Management
3. Create a new AccessKey pair
4. Save the secret immediately — it's only shown once

### Configuration Modes

Aliyun CLI supports 6 authentication modes. All examples below use non-interactive flags.

#### 1. AK Mode (Access Key)

Most common mode for personal accounts and scripts.

```bash
aliyun configure set \
  --mode AK \
  --access-key-id LTAI5tXXXXXXXX \
  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
  --region cn-hangzhou
```

Configuration is stored in `~/.aliyun/config.json`:

```json
{
  "current": "default",
  "profiles": [
    {
      "name": "default",
      "mode": "AK",
      "access_key_id": "LTAI5tXXXXXXXX",
      "access_key_secret": "8dXXXXXXXXXXXXXXXXXXXXXXXX",
      "region_id": "cn-hangzhou",
      "output_format": "json",
      "language": "en"
    }
  ]
}
```

#### 2. StsToken Mode (Temporary Credentials)

For short-lived access (tokens expire in 1-12 hours).

```bash
aliyun configure set \
  --mode StsToken \
  --access-key-id LTAI5tXXXXXXXX \
  --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \
  --sts-token v1.0:XXXXXXXXXXXXXXXX \
  --region cn-hangzhou
```

Use cases: CI/CD pipelines, temporary access for external contractors, cross-account access.

#### 3. RamRoleArn Mode (Assume RAM Role)

Assume a RAM role for elevated or cross-account access.

```bash
aliyun configure set \
  
Github ReposUpdated 1d agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/sdk-team/skills/alibabacloud-sls-query",
      "sourceUrl": "https://clawhub.ai/sdk-team/skills/alibabacloud-sls-query",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-11T04:02:31.758Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-sls-query/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-sls-query/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-11T04:02:31.758Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "1.2K downloads",
      "href": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceUrl": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-11T04:02:31.758Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "0.0.2",
      "href": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceUrl": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-06-29T02:00:04.266Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-sls-query/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-sls-query/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 0.0.2",
      "description": "alibabacloud-sls-query v0.0.2 - Added explicit per-session random user-agent format requirement for all aliyun API commands, enhancing observability and traceability. - Updated prerequisite steps: removed AI mode instructions; clarified plugin update and user-agent requirements. - Improved documentation across references and guides for more concise, accurate workflow and permission setup. - Removed unused or obsolete files (e.g., skill-card.md). - Expanded details for session/user-agent usage and security policy adherence.",
      "href": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceUrl": "https://clawhub.ai/sdk-team/alibabacloud-sls-query",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-06-29T02:00:04.266Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 11, 2026.

Sponsored

Ads related to Alibabacloud Sls Query and adjacent AI workflows.