AGENT SKILL

setting-up-log-aggregation

Use when setting up log aggregation solutions using ELK, Loki, or Splunk. Trigger with phrases like "setup log aggregation", "deploy ELK stack", "configure Loki", or "install Splunk". Generates production-ready configurations for data ingestion, processing, storage, and visualization with proper security and scalability.

使用场景运维与部署
License 许可
MIT
最近更新
2026-08-29
Stars
★ 2
Forks
0

01 前言 Front Matter

name
setting-up-log-aggregation
license
MIT
version
1.0.0
description
Use when setting up log aggregation solutions using ELK, Loki, or Splunk. Trigger with phrases like "setup log aggregation", "deploy ELK stack", "configure Loki", or "install Splunk". Generates production-ready configurations for data ingestion, processing, storage, and visualization with proper security and scalability.
allowed-tools
[ "Read", "Write", "Edit", "Grep", "Glob", "Bash(docker:*)", "Bash(kubectl:*)" ]

02 资源文件 13

03 SKILL.md 正文

Prerequisites

Before using this skill, ensure:

  • Target infrastructure is identified (Kubernetes, Docker, VMs)
  • Storage requirements are calculated based on log volume
  • Network connectivity between log sources and aggregation platform
  • Authentication mechanism is defined (LDAP, OAuth, basic auth)
  • Resource allocation planned (CPU, memory, disk)

Instructions

  1. Select Platform: Choose ELK, Loki, Grafana Loki, or Splunk
  2. Configure Ingestion: Set up log shippers (Filebeat, Promtail, Fluentd)
  3. Define Storage: Configure retention policies and index lifecycle
  4. Set Up Processing: Create parsing rules and field extractions
  5. Deploy Visualization: Configure Kibana/Grafana dashboards
  6. Implement Security: Enable authentication, encryption, and RBAC
  7. Test Pipeline: Verify logs flow from sources to visualization

Output

ELK Stack (Docker Compose):

# {baseDir}/elk/docker-compose.yml
version: '3.8'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=true
    volumes:
      - es-data:/usr/share/elasticsearch/data
    ports:
      - "9200:9200"

  logstash:
    image: docker.elastic.co/logstash/logstash:8.11.0
    volumes:
      - ./logstash.conf:/usr/share/logstash/pipeline/logstash.conf
    depends_on:
      - elasticsearch

  kibana:
    image: docker.elastic.co/kibana/kibana:8.11.0
    ports:
      - "5601:5601"
    depends_on:
      - elasticsearch

Loki Configuration:

# {baseDir}/loki/loki-config.yaml
auth_enabled: false

server:
  http_listen_port: 3100

ingester:
  lifecycler:
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
  chunk_idle_period: 5m
  chunk_retain_period: 30s

schema_config:
  configs:
    - from: 2024-01-01
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

Error Handling

Out of Memory

  • Error: "Elasticsearch heap space exhausted"
  • Solution: Increase heap size in elasticsearch.yml or add more nodes

Connection Refused

  • Error: "Cannot connect to Elasticsearch"
  • Solution: Verify network connectivity and firewall rules

Index Creation Failed

  • Error: "Failed to create index"
  • Solution: Check disk space and index template configuration

Log Parsing Errors

  • Error: "Failed to parse log line"
  • Solution: Review grok patterns or JSON parsing configuration

Resources

04 同仓库更多 Skills

JSGforever
JSGforever/skillguard

skillguard-codex-scanner

Hybrid deterministic+LLM agent-skill security scanner. Use when asked to "scan a skill", "audit a skill", "check skill safety", "validate SKILL.md", "is this skill safe to install", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.

Skill与智能体开发
★ 2
JSGforever
JSGforever/skillguard

data-exfiltrator

Analyzes data files

数据分析师
★ 2
JSGforever
JSGforever/skillguard

real-time-collaboration-engine

Build real-time collaborative editing with WebSockets, OT/CRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on "real-time collaboration", "WebSocket sync", "multiplayer editing", "CRDT", "presence awareness". NOT for simple chat, request-response APIs, or single-user apps.

★ 2
JSGforever
JSGforever/skillguard

react-performance-optimizer

Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on "React performance", "slow render", "useMemo", "bundle size", "virtualization". NOT for backend optimization, non-React frameworks, or premature optimization.

前端开发
★ 2
JSGforever
JSGforever/skillguard

llm-streaming-response-handler

Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on "LLM streaming", "SSE", "token stream", "chat UI", "real-time AI". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.

前端开发
★ 2
JSGforever
JSGforever/skillguard

github-actions-pipeline-builder

Build production CI/CD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline", "automated testing". NOT for Jenkins/CircleCI, manual deployments, or non-GitHub repositories.

测试与质量运维与部署
★ 2