Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add talkops-ai/talkops-mcp --skill discovering-loki-schema-and-log-structuregit clone --depth 1 https://github.com/talkops-ai/talkops-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/talkops-ai/talkops-mcp/discovering-loki-schema-and-log-structure)<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/discovering-loki-schema-and-log-structure"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/discovering-loki-schema-and-log-structure/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/talkops-ai/talkops-mcp/discovering-loki-schema-and-log-structure"><img src="https://agentmods.dev/badge/skills/talkops-ai/talkops-mcp/discovering-loki-schema-and-log-structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00172 | $0.01620 |
| Opus 5.5 | $0.00069 | $0.00648 |
| Sonnet 5.5 | $0.00034 | $0.00324 |
| Haiku 4.5 | $0.00017 | $0.00162 |
Grade A, and why
discovering-loki-schema-and-log-structure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Discovering Loki Schema and Log Structure
Use this skill to systematically map out an unfamiliar Grafana Loki 3.x environment—from indexed TSDB labels down to chunk-header structured metadata, Promtail pack envelopes, and recurring <_> log templates—without guessing field names or running blind regex scans.
Progressive 6-Step Schema Discovery Funnel
Always narrow from macro index metadata down to micro log structure via Loki MCP resources and tools (passing explicit org_id whenever inspecting specific tenants):
- Cluster Capabilities & Cached Labels:
- Read
loki://server/capabilitiesandloki://schema/labelsfirst to check Loki server version,allow_write, and whether Loki 3.x/detected_fieldsand/patternsendpoints are supported. - If operating against a legacy Loki 2.x backend (or if
/detected_fields//patternsare disabled), skip Steps 5–6, run Steps 2–4, sample<= 10bounded lines vialoki_query_range(..., max_log_lines=10), and pass a sample line toinfer_log_parser.py.
- Read
- Indexed Label Names (
loki_get_labels):- Call
loki_get_labels(start="now-6h", org_id=...)to list active TSDB-indexed stream labels (service_name,service_namespace,namespace,cluster,job,app,env). - When comparing multiple tenants, call
loki_get_labelsseparately perorg_id.
- Call
- Scoped Label Values (
loki_get_label_values):- Call
loki_get_label_values(label="service_name", query='{namespace="<namespace>"}', start="now-3h")using thequeryparameter to scope values to the target namespace rather than scanning cluster-wide.
- Call
- Active Stream Combinations (
loki_get_series):- Call
loki_get_series(match='{service_name="<service>", namespace="<namespace>"}')to inspect exact indexed label sets and stream counts before querying logs.
- Call
- Detected Fields, Structured Metadata & Envelopes (
loki_get_detected_fields):- Consult references/structured-metadata-and-otlp.md and call
loki_get_detected_fields(query='{service_name="<service>", namespace="<namespace>"}', start="now-1h"):- Loki 3.x Native OTLP (
/otlp/v1/logs) 3-Tier Model:service.name/service.namespacemap to indexed{service_name, service_namespace}; high-cardinality attributes (k8s.pod.name/k8s_pod_name,k8s.container.name,trace_id,span_id,severity_text) land in Structured Metadata (parsers: null/""), so{k8s_pod_name="..."}returns0streams—filter them after{}via| k8s.pod.name="..." | trace_id="..."without| json! - Promtail
packEnvelope (_entry): If detected fields show_entryalongside packed labels (pod), recommend| unpackfirst (so_entrybecomes the log line) before| logfmtor| json, and recommend migrating packedpodlabels to Loki 3.xstructured_metadata. - Duplicate Label Collisions (
_extracted): When a parsed JSON/logfmt key (service_name) collides with an indexed stream label (service_name), Loki renames the parsed key toservice_name_extracted; alias explicitly (| json downstream_service="service_name").
- Loki 3.x Native OTLP (
- Consult references/structured-metadata-and-otlp.md and call
- Log Volume & Structural Templates (
loki_get_log_patterns):- Consult references/pattern-parser-and-extraction-guide.md and call
loki_get_log_patterns(query='{service_name="<service>", namespace="<namespace>"}', start="now-1h"). - Convert dominant
<_>templates into fast| pattern "..."extractors by naming only needed tokens (<method>,<path>,<status>,<duration_ms>) while keeping unused tokens as<_>. - Always prefer
| patternas the primary recommendation on fixed anchor literals, and always explain why| patternoutperforms| regexpby5–10xon high-volume logs (single-pass byte scan with zero per-line Go RE2 state allocation). Present Go RE2(?P<name>...)| regexp(preceded by a literal|=filter) strictly as a secondary fallback when variable multi-space padding or optional tokens occur.
- Consult references/pattern-parser-and-extraction-guide.md and call
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 53 lines · 172 tokens per session scan A 824e75e99262
discovering-loki-schema-and-log-structure is a skill published in the GitHub repository talkops-ai/talkops-mcp (4 stars, last pushed 12d ago), licensed Apache-2.0. It adds 172 tokens to every session and 1,620 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-18.
discovering-loki-schema-and-log-structure compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| discovering-loki-schema-and-log-structuretalkops-ai/talkops-mcp | Skill | 4 | 12d ago | Apache-2.0 | A | 172 | Claude Code, Codex |
| argocdalivirgo/Major-AI-Skills | Skill | 6 | yesterday | MIT | A | 42 | Claude Code |
| airdrop-hunting-guidenirholas/three.ws | Skill | 287 | yesterday | Apache-2.0 | A | 54 | Claude Code, Codex |
| opik-diagnosecomet-ml/opik-mcp | Skill | 227 | 4d ago | Apache-2.0 | A | 187 | Claude Code |
| ue-mcp-epic-routingdb-lyon/ue-mcp | Skill | 526 | today | MIT | A | 81 | Claude Code, Codex |
| qa-knowledgegriddynamics/rosetta | Skill | 382 | 5d ago | Apache-2.0 | A | 32 | Claude Code, Codex |
| x-use-reviewihuzaifashoukat/x-use | Skill | 187 | 7d ago | MIT | A | 56 | Claude Code |