Giter Club home page Giter Club logo

sysflux's Introduction

sysflux

Sysflux transforms RFC3164 syslog messages sent via UDP into influxdb data points. Any log message can be parsed by defining a custom regular expression.

Regular Expression Syntax

All named capture groups of the regex are ether parsed to a datapoint value or a datapoint tag. To parse a tag, add the "tag_" prefix to the name of the capture group. Values are parsed as floats if the "val_" prefix is configured in the name of the capture group.

Example: NGINX Upstream Timing

Configure custom access log format in NGINX and send to a remote syslog server.

/etc/nginx/nginx.conf:

...
log_format  metric  '$host $uri $upstream_status $upstream_connect_time $upstream_header_time $upstream_response_time $request_time';
access_log syslog:server=<sysfluxip>:5014,facility=local7,tag=nginx,severity=info metric;
...

/etc/sysflux/sysflux.yml:

influx:
  addr: http://127.0.0.1:8086
  user: test
  password: test
  database: test

syslog:
  - measurement: http_proxy
    listen: 0.0.0.0:5014
    batch_size: 25
    batch_timeout: 1s
    regex: "(?P<tag_host>.+)\\s+(?P<tag_url>.+)\\s+(?P<tag_status>.+)\\s+(?P<val_upstream_connect>.+)\\s+(?P<val_upstream_header>.+)\\s+(?P<val_upstream_response>.+)\\s+(?P<val_request_time>.+)"

Disclaimer

This software has not yet been tested in production. Please be carefull!

sysflux's People

Contributors

faryon93 avatar

Watchers

 avatar  avatar

sysflux's Issues

batch write size configurable

The batch size, when datapoints should be written to influxdb, should be configurable per syslog instance. This should increase the performance when receiving a large amount of logs.

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.