Skip to content
cccskills
FreePublished on GitHub

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.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

obz-loki: Grafana Loki Provider

Quick Reference

FieldValue
Aliasesloki
SignalLog
Query languageLogQL
AuthBearer token or Basic auth
Provider flagsNone
Supported cmdslog search, labels, label-values, fields, stats

Supported Commands

Core log commands

obz log search         # Search log entries using LogQL

Extension commands

obz log labels         # List label names (no flags)
obz log label-values   # List values for a label (requires --label)
obz log fields         # List detected fields (optional --query)
obz log stats          # Run instant aggregation (requires --query with LogQL metric query)

Authentication

Configure auth in config.yaml under providers.<name>.auth. Supports bearer token, basic auth, or no auth.

# config.yaml
providers:
  loki:
    endpoint: http://localhost:3100
    auth:
      token: ${env:LOKI_TOKEN}

For basic auth (common with Grafana Cloud):

    auth:
      username: user
      password: ${env:LOKI_PASS}

Then query with just -p:

obz log search -p loki -q '{job="api"} |= "error"' --from now-1h

LogQL Guide

LogQL is Loki's query language. Every query starts with a log stream selector (labels in curly braces), optionally followed by filter and parser stages.

Stream Selectors

{job="api"}                          # exact match
{job="api", env="prod"}              # multiple labels
{job=~"api|web"}                     # regex match
{job!="debug"}                       # not equal

Line Filters

{job="api"} |= "error"              # line contains "error"
{job="api"} != "health"             # line does NOT contain "health"
{job="api"} |~ "status=[45]\\d{2}"  # line matches regex
{job="api"} !~ "debug|trace"        # line does NOT match regex

Parser Stages

{job="api"} | json                   # parse JSON fields
{job="api"} | logfmt                 # parse logfmt fields
{job="api"} | json | level="error"   # parse then filter by field

Chaining Filters

Filters chain left to right. Each stage narrows the results further:

{job="api"} |= "error" != "timeout" | json | status >= 500

Examples

Basic log search:

obz log search -p loki -q '{job="api"} |= "error"' --from now-1h

Search with regex filter:

obz log search -p loki \
  -q '{job="api"} |~ "status=(500|502|503)"' --from now-6h

Parse JSON logs and filter by field:

obz log search -p loki \
  -q '{job="api"} | json | level="error"' --from now-30m

Multi-label selector:

obz log search -p loki \
  -q '{job="api", env="prod", cluster="us-east"}' --from now-1h

List label names:

obz log labels -p loki

List values for a label:

obz log label-values -p loki --label job

List detected fields:

obz log fields -p loki -q '{job="api"}' --from now-1h

Stats aggregation (instant query):

obz log stats -p loki -q 'count_over_time({job="api"}[5m])' --from now-1h

Tips

  • Labels are indexed. Put your most selective label first for better performance.
  • Line filters (|=, !=) are fast. Use them before parser stages to reduce the volume of data Loki has to parse.
  • Quote your LogQL with single quotes on the CLI to avoid shell interpretation of curly braces and pipes.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

obz-dd

Free

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

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.

The English summary is being prepared. Showing the original description.

alibaba/obz-cli28Updated Jul 12, 2026

See all skills by alibaba

Report a problem with this skill