Works with the AI Agents you already use

    ECS Logging Retrofit

    by Erick CM

    1

    Retrofit applications with ECS-compliant structured JSON logging and Filebeat configs for seamless ELK integration.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    ECS Logging Retrofit

    ECS Logging Retrofit

    Example session with this skill installed

    make this app ELK-ready

    • Read your context and instructions
    • Compiled the ecs logging retrofit

    I have audited the codebase and identified 14 logging statements. The application currently uses Winston with three different formats. I will convert these to @elastic/ecs-winston-format and provide a Docker-ready Filebeat configuration.

    Log Audit and Proposal

    File:lineCurrent callLevelProposed ECS messageExtra fields
    auth.js:12logger.info("User " + id + " logged in")info"user logged in"labels.user_id, event.outcome: success
    db.js:45logger.error("Query failed: " + err)error"database query failed"error.message, error.stack_trace
    middleware.js:8console.log("Request received")debugdropN/A (high volume)

    Implementation: Winston ECS Formatter

    const winston = require('winston');
    const { ecsFormat } = require('@elastic/ecs-winston-format');
    
    const logger = winston.createLogger({
      level: 'info',
      format: ecsFormat({ serviceName: process.env.SERVICE_NAME || 'auth-service' }),
      transports: [
        new winston.transports.Console()
      ]
    });
    
    // Example Rewrite:
    // Old: logger.info("User " + user.id + " logged in");
    logger.info("user logged in", { labels: { user_id: user.id }, event: { outcome: 'success', action: 'login' } });
    

    Filebeat Configuration (filebeat.ecs.yml)

    filebeat.inputs:
      - type: container
        id: auth-service-logs
        paths:
          - /var/lib/docker/containers/*/*.log
        parsers:
          - ndjson:
              target: ""
              overwrite_keys: true
              add_error_key: true
    
    processors:
      - drop_event:
          when:
            equals:
              log.level: "debug"
    
    output.elasticsearch:
      hosts: ["${ELASTIC_HOST}"]
      indices:
        - index: "logs-auth-service-%{+yyyy.MM.dd}"
    
    setup.ilm.enabled: true
    

    Next steps

    1. Run npm install @elastic/ecs-winston-format to add the formatter.
    2. Replace the Winston configuration in logger.js with the block above.
    3. Deploy the Filebeat sidecar using the provided YAML.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Getting an existing app's logs into ELK properly is a half-day chore: read the ECS field reference, hunt down every print and console.log, wire the right formatter, rewrite calls so variables become fields, then hand-write a Filebeat config and debug the lines that don't parse.

    This skill does that work in one command.

    What it does

    • Audits every log call in the codebase and shows a keep / enrich / drop table you approve before anything changes
    • Flags secrets and personal data being written to logs, a real finding on most codebases
    • Converts to the official ECS formatter for the logger you already have: Python logging, winston, pino, logback, log4j2, monolog, zap and more
    • Rewrites calls so variables become queryable fields like labels.order_id, event.duration, and error.stack_trace
    • Generates a working filebeat.ecs.yml for your runtime (bare metal, Docker, or k8s)
    • Verifies real output lines are valid ECS JSON before declaring done

    You never write grok patterns, ingest pipelines, or custom index mappings.

    Proven on a real service

    The included examples come from a run on a production NestJS API. That audit also caught the app's only error log being dead code: NestJS's default abortOnError exits the process before bootstrap().catch ever fires. The retrofit fixes it.

    What's in the zip

    SKILL.md, install guide, real example output (examples/*.ndjson), and a license for you and your team. Setup is copying one folder. Works with Elastic Stack 8.x.

    No native support for C++ or Ruby libraries. Requires the application to use a supported logging framework or standard output for the audit to be effective.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    It eliminates manual logging configuration by auditing your code, converting print statements to ECS-compliant JSON, and generating ready-to-use Filebeat configurations for ELK integration.

    The skill supports most major logging frameworks across languages, including Python's logging, JavaScript's Winston and Pino, Java's Logback and Log4j2, and Go's Zap.

    Beyond formatting, it automatically identifies and flags potential PII or hardcoded secrets in your log calls, allowing you to redact sensitive data before it reaches your ELK stack.

    You receive the core skill file (SKILL.md), a comprehensive installation guide, a license for your team, and real-world example outputs to verify your setup against.

    Yes, the skill is designed to generate specific configurations for bare metal, Docker, or Kubernetes environments, ensuring your Filebeat setup matches your actual infrastructure.

    No, the skill generates structured ECS JSON that is natively understood by Elasticsearch 8.x, completely removing the need to write complex Grok patterns or custom ingest pipelines.

    New in DevOps & Cloud

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.