log-aggregation

A guide to collecting, storing, searching, and displaying application logs with the ELK Stack: Elasticsearch, Logstash, and Kibana. Filebeat and related tools can forward logs and metrics into the system.

In plain words
What is it for?
Deploying Elasticsearch, building Logstash pipelines, configuring Filebeat or Metricbeat, creating Kibana dashboards and alerts, and checking cluster, index, and shard health.
Why use it?
It helps find where log data is lost or malformed and diagnose unhealthy Elasticsearch clusters. It replaces scattered log files with searchable records and dashboards.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/aspectrr/deer/log-aggregation
Any agent
npx skills add aspectrr/deer --skill log-aggregation
Clone the repo
git clone --depth 1 https://github.com/aspectrr/deer

Made for: Claude Code, Codex.

Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,496 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00044 $0.01496
Opus 5 $0.00022 $0.00748
Sonnet 5 $0.00009 $0.00299
Haiku 4.5 $0.00004 $0.00150

Measured 2d ago against content hash 2a2bc17ebd48, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

log-aggregation scanned grade B with 2 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 2d 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -X PUT localhost:9200/my-index -H 'Content-Type: application/json' -d '

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s localhost:9200/_cluster/health?pretty
deer-cli/internal/skill/defaults/log-aggregation/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Log Aggregation (ELK Stack)

When to Use

  • Deploying or configuring Elasticsearch clusters
  • Building Logstash pipelines (inputs, filters, outputs)
  • Configuring Filebeat/Metricbeat/Heartbeat shippers
  • Setting up Kibana dashboards and alerts
  • Debugging log flow from source to Elasticsearch
  • Diagnosing cluster health (red/yellow status)

Elasticsearch

Cluster Health

# Overall cluster status
curl -s localhost:9200/_cluster/health?pretty

# Node-level stats
curl -s localhost:9200/_nodes/stats?pretty

# Shard allocation explanation (when yellow/red)
curl -s localhost:9200/_cluster/allocation/explain?pretty

# Index-level health
curl -s localhost:9200/_cat/indices?v&health=yellow
curl -s localhost:9200/_cat/indices?v&health=red

Index Management

# List indices with sizes
curl -s localhost:9200/_cat/indices?v&h=index,docs.count,store.size,pri,rep

# Create index with mapping
curl -X PUT localhost:9200/my-index -H 'Content-Type: application/json' -d '
{
  "mappings": {
    "properties": {
      "@timestamp": { "type": "date" },
      "message": { "type": "text" },
      "host": { "type": "keyword" },
      "level": { "type": "keyword" }
    }
  }
}'

# Delete index
curl -X DELETE localhost:9200/my-index

# Force merge (reduce segments)
curl -X POST "localhost:9200/my-index/_forcemerge?max_num_segments=1"

Cluster Red/Yellow Diagnosis

  1. Check health: curl localhost:9200/_cluster/health?pretty
  2. Check unassigned shards: curl localhost:9200/_cat/shards?v&h=index,shard,_pri,state,node&s=state
  3. Get allocation explanation: curl -X POST localhost:9200/_cluster/allocation/explain?pretty
  4. Common causes: disk watermark exceeded, node down, replica count > data nodes
  5. Check disk: curl localhost:9200/_cat/allocation?v
  6. Check settings: curl localhost:9200/_cluster/settings?include_defaults=true&flat_settings=true

Logstash

Pipeline Configuration

# /etc/logstash/pipeline/my-pipeline.conf

input {
  kafka {
    bootstrap_servers => "kafka:9092"
    topics => ["logs"]
    group_id => "logstash-consumer"
    consumer_threads => 4
  }
}

filter {
  grok {
    match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}" }
  }
  date {
    match => ["timestamp", "ISO8601"]
    target => "@timestamp"
  }
  mutate {
    remove_field => ["timestamp"]
  }
}

output {
  elasticsearch {
    hosts => ["elasticsearch:9200"]
    index => "logs-%{+YYYY.MM.dd}"
  }
}

Read the full file on GitHub · 219 lines

Changes

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.

  1. 2d ago First seen · 219 lines · 44 tokens per session scan B 2a2bc17ebd48

Subscribe to this mod's changes

log-aggregation is a skill published in the GitHub repository aspectrr/deer (404 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 1,496 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cli-anything-jumpserver

Stateful CLI harness for JumpServer bastion host management. Supports asset, user, permission, account, session, audit, and operations management via REST API, with both one-shot and interactive REPL modes.

HKUDS/CLI-Anything · 49 tokens

architecture-diagram

Dark-themed SVG architecture/cloud/infra diagrams as HTML.

mateaix/mateclaw · 15 tokens

asn-infrastructure-mapping

Map organization IP infrastructure via ASN, CIDR, TLD expansion, and reverse DNS.

uphiago/recon-skills · 24 tokens

skypilot-multi-cloud-orchestration

Multi-cloud orchestration for ML workloads with automatic cost optimization. Use when you need to run training or batch jobs across multiple clouds, leverage spot instances with auto-recovery, or optimize GPU costs across providers.

Orchestra-Research/AI-Research-SKILLs · 51 tokens

figma-use

MANDATORY prerequisite — you MUST invoke this skill BEFORE every usefigma tool call. NEVER call usefigma directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in…

novuhq/novu · 114 tokens

novu-inbox-integration

Integrate Novu's in-app notification inbox into web applications. Supports React, Next.js, and vanilla JavaScript. Includes the Inbox component (bell icon + notification feed), composable components (Bell, Notifications, InboxContent, Preferences), headless hooks, branded theming, custom render props, multi-tenancy…

novuhq/novu · 111 tokens