Skip to main content

obz-opensearch

OpenSearch provider for obz. Supports log search and trace operations using Lucene-based query syntax. Requires --index flag. This skill should be used when the user mentions "OpenSearch", "obz -p os", or needs to search logs or traces from an OpenSearch cluster.

소스 정보

저장소
alibaba/obz-cli
최근 소스 활동
2026년 4월 29일 07:18
감지된 SKILL.md 언어
영어
스타
27
포크
9

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
obz-opensearch
description
OpenSearch provider for obz. Supports log search and trace operations using Lucene-based query syntax. Requires --index flag. This skill should be used when the user mentions "OpenSearch", "obz -p os", or needs to search logs or traces from an OpenSearch cluster.
# obz-opensearch: OpenSearch Provider ## Quick Reference | Field | Value | |------------------|----------------------------------------------------| | Aliases | `os`, `opensearch` | | Signals | Log, Trace | | Query language | OpenSearch DSL (Lucene-based query string) | | Auth | Basic auth or bearer token (in config.yaml) | | Provider flags | `--index` (required at runtime) | | Supported cmds | log search, trace search, trace get | ## Supported Commands ``` obz log search # Search log entries in an OpenSearch index obz trace search # Search trace spans in an OpenSearch index obz trace get # Retrieve a trace by ID from OpenSearch ``` ## Provider-Specific Flags | Flag | Type | Required | Description | |-------------|--------|----------|------------------------------------------| | `--index` | String | Yes | Index name or pattern to query | The `--index` flag is declared optional at the clap level (so other providers don't error), but OpenSearch enforces it at runtime. Omitting it will produce a clear error message. ## Authentication Configure auth in `config.yaml` under `providers.<name>.auth`. Supports either basic auth or bearer token. **Basic auth**: ```yaml # config.yaml providers: os: endpoint: https://opensearch.example.com index: logs-* auth: username: admin password: ${env:OS_PASS} ``` **Bearer token**: ```yaml providers: os: endpoint: https://opensearch.example.com index: logs-* auth: token: ${env:OS_TOKEN} ``` Then query with just `-p`: ```bash obz log search -p os -q 'level:ERROR' --from now-1h ``` ## Query Language OpenSearch accepts Lucene-based query strings in the `-q` parameter. ### Common Patterns ``` level:ERROR # field match level:ERROR AND service:api # boolean AND status:(404 OR 500) # grouped OR message:"connection refused" # phrase match host:web-* AND NOT path:/health # wildcards and negation response_time:[500 TO *] # range query ``` ### Tips - Field names are case-sensitive and must match your index mapping. - Use double quotes for exact phrase matches. - Wildcards (`*`, `?`) work in field values but not at the start of a term by default (it's expensive). ## Examples **Search logs by level**: ```bash obz log search -p os --index 'logs-*' -q 'level:ERROR' --from now-1h ``` **Search with boolean operators**: ```bash obz log search -p os --index 'app-logs' \ -q 'service:api AND status:500' --from now-6h ``` **Search traces**: ```bash obz trace search -p os --index 'traces-*' -q 'service:frontend' --from now-1h ``` **Retrieve a specific trace**: ```bash obz trace get -p os --index 'traces-*' abc123def456 ```
GitHub에서 보기