Git Product home page Git Product logo

draff's Introduction

Draff

Inputs logs, outputs a daily email summary.

Helps find unusual/interesting/concerning log messages among the morass of draff. Similar to Logwatch or Epylog, but designed to integrate with ELK (Logstash + Elasticsearch + Kibana).

An annotated screenshot of an email generated by Draff.

Setup

  1. Write logs to a daily newline-delimited JSON dumpfile

    • Configure Logstash
      output {
         …
         file {
            path => '/var/log/logstash/dump-%{+YYYYMMdd}.ndjson'
            codec => json_lines
         }
      }
      
    • Optionally configure Logstash to assign a unique ID to each log event before indexing to Elasticsearch
      filter {
         …
         uuid {
            target => '_id'
         }
      }
      output {
         elasticsearch {
            document_id => '_id'
            …
         }
         …
      }
      

      Now Logstash will write the unique ID to the JSON dumpfile, which enables Draff to provide a link from the email to the Kibana document viewer. (Without this, Elasticsearch will automatically assign a unique ID, but Logstash won't know about it.)

    • Optionally configure Logrotate to delete old daily dumpfiles.

  2. Send daily summary emails

    • Install PHP 8 and the PHP PECL yaml extension (e.g. dnf install php-pecl-yaml)
    • Copy example-draff.yaml to draff.yaml, then:
      • ⚙️ Adjust the general configuration
      • 📋 Define custom tables/aggregations
      • 📎 Define custom annotations
      • 🔀 Define custom text replacements/deduplications
    • Add a crontab entry to run it daily:
      10 0 * * * /opt/draff/draff --yesterday --html --email
  3. Review the daily summary emails to find out about exciting new problems.

    • The email is formatted so you can copy-paste multiple lines into a text editor, and they'll line up nicely: An annotated screenshot showing text copy-pasted from a Draff email into a text editor.

draff's People

Contributors

smokris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.