跳到正文
cccskills
免费在 GitHub 公开

obz-elasticsearch

Elasticsearch provider for obz. Supports log search and trace operations using Elasticsearch Query DSL (Lucene-based). Requires --index flag. This skill should be used when the user mentions "Elasticsearch", "obz -p es", or needs to search logs or traces from an Elasticsearch cluster.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md3.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

obz-elasticsearch: Elasticsearch Provider

Quick Reference

FieldValue
Aliaseses, elasticsearch
SignalsLog, Trace
Query languageElasticsearch Query DSL (Lucene-based)
AuthBasic auth, bearer token, or API key (in config.yaml)
Provider flags--index (required at runtime)
Supported cmdslog search, trace search, trace get

Supported Commands

obz log search       # Search log entries in an Elasticsearch index
obz trace search     # Search trace spans in an Elasticsearch index
obz trace get        # Retrieve a trace by ID from Elasticsearch

Provider-Specific Flags

FlagTypeRequiredDescription
--indexStringYesIndex name or pattern to query

The --index flag is declared optional at the clap level (so other providers don't error), but Elasticsearch enforces it at runtime.

Authentication

Configure auth in config.yaml under providers.<name>.auth. Priority: API key > bearer token > basic auth.

Basic auth:

# config.yaml
providers:
  es:
    endpoint: https://es.example.com
    index: logs-*
    auth:
      username: elastic
      password: ${env:ES_PASS}

Bearer token:

    auth:
      token: ${env:ES_TOKEN}

API key (Authorization: ApiKey <key>):

    auth:
      api-key: ${env:ES_API_KEY}

Then query with just -p:

obz log search -p es -q 'level:ERROR' --from now-1h

Query Language

Elasticsearch accepts Lucene-based query strings in the -q parameter. The syntax is nearly identical to OpenSearch.

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 depend on your index mapping.
  • Use double quotes for exact phrase matches.
  • Leading wildcards (*error) are disabled by default for performance.

Elasticsearch vs OpenSearch

Both providers share the same query syntax and flag surface. The main difference is the backend API version and endpoint format.

AspectElasticsearchOpenSearch
Aliasesos
Auth optionsBasic + bearer + API keyBasic + bearer
API lineageElastic N.V.AWS fork

If your cluster is OpenSearch, use the os provider instead.

Examples

Search logs by level:

obz log search -p es --index 'logs-*' -q 'level:ERROR' --from now-1h

Search with boolean operators:

obz log search -p es --index 'app-logs' \
  -q 'service:api AND status:500' --from now-6h

Search traces:

obz trace search -p es --index 'traces-*' -q 'service:frontend' --from now-1h

Retrieve a specific trace:

obz trace get -p es --index 'traces-*' abc123def456

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

obz-core

免费

Multi-backend observability CLI for querying metrics, logs, and traces across 12 backends. This skill should be used when the user runs obz commands, constructs metric/log/trace queries, configures providers, parses obz JSON output, or troubleshoots obz errors. Covers all core commands (metric query/list/info/labels/label-values/series, log search, trace search/get), global flags, time formats, output modes, config files, and exit codes.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

obz-dd

免费

Datadog provider for obz. Supports metrics (Datadog Query Language), logs (Datadog Log Query), and traces. Requires api-key and app-key configured under auth in config.yaml. Does not support metric labels, label-values, or series commands. This skill should be used when the user mentions "Datadog", "DD", "obz -p dd", Datadog Query Language, or needs to configure Datadog provider instances with regional endpoints.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

GreptimeDB provider for obz. Covers PromQL metric query, labels, label-values, and series commands via GreptimeDB's Prometheus-compatible API. Use this skill when the user mentions "GreptimeDB", "Greptime", "obz metric -p greptimedb", or needs to query metrics stored in a GreptimeDB instance.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

Jaeger provider for obz. Covers trace search, trace retrieval by ID, and extension commands for service and operation discovery. This skill should be used when the user mentions "Jaeger", "obz trace -p jg", or needs to search distributed traces from a Jaeger backend.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

obz-loki

免费

Grafana Loki provider for obz. Covers log search using LogQL, a label-based query language for log aggregation. This skill should be used when the user mentions "Loki", "Grafana Loki", "LogQL", "obz log search -p loki", or needs to search logs from a Loki instance.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

obz-mimir

免费

Grafana Mimir provider for obz. Covers all 6 metric commands using standard PromQL. Mimir is a horizontally-scalable Prometheus-compatible TSDB. This skill should be used when the user mentions "Mimir", "Grafana Mimir", "obz metric -p mimir", or needs to query metrics from a Mimir cluster.

中文简介正在准备中。当前显示原文说明。

alibaba/obz-cli282026年7月12日 更新

查看 alibaba 的全部技能

报告此技能的问题