GithubHelp home page GithubHelp logo

kazegusuri / fluent-plugin-bufferize Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 7.0 8 KB

A fluentd plugin that enhances existing non-buffered output plugin as buffered plugin.

License: MIT License

Ruby 100.00%

fluent-plugin-bufferize's Introduction

fluent-plugin-bufferize, a plugin for Fluentd

An adapter plugin which enables existing non-buffered plugins to resend messages easily in case of unexpected exceptions without creating duplicate messages.

Why

Buffered plugin accumulates many messages in buffer and sends all the messages at a same time. There are many APIs that does not support such reqeusts like bulk-insert. In that case, you have to use non-buffered output and implement resend meschanism yourself because non-buffered output lacks exception handling functionality.

To use this plugin, you just have to create non-buffered plugin without caring exception handling. If an exception happens in your plugin, the request is issued again automatically. With file buffer, none of messages are lost even on sudden fluentd process down.

Configuration

Just embrace existing configuration by directive.

If you use following configuration:

<match *>
  type http
  endpoint_url    http://foo.bar.com/
  http_method     put
</match>

Modify it like this:

<match *>
  type bufferize
  buffer_type file
  buffer_path /var/log/fluent/myapp.*.buffer
  <config>
    type http
    endpoint_url    http://foo.bar.com/
    http_method     put
  </config>
</match>

This is a buffered output plugin. For more information about parameters, please refer official document.

Example of application

These plugins are good compatibility to fluent-plugin-bufferize.

Installation

Add this line to your application's Gemfile:

gem 'fluent-plugin-bufferize'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fluent-plugin-bufferize

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

AuthorMasahiro Sano
CopyrightCopyright (c) 2013- Masahiro Sano
LicenseMIT License

fluent-plugin-bufferize's People

Contributors

kazeburo avatar kazegusuri avatar kiyoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fluent-plugin-bufferize's Issues

Keep original timestmap

Hi,
I am using this plugin in combination with https://github.com/ento/fluent-plugin-out-http to send logs from supervisor (which users this script: https://github.com/Globegitter/supervisor2fluentd/blob/nanosecond-precision/supervisor2fluentd.py). This python script emits an event to fluent with tag and timestamp which I then want to forward on. However I have notice that all the logs coming in with the same batch have the same timestamp (well, different on subsecond level), even though in reality they are logged out at different times. If I reduce the flush_interval from e.g. 10s to 1s I get the accurate timestamps.

Is this intended with this plugin and is there some way to preserve the original timestamp I am emitting?

I am using buffer_type file btw, not sure if it makes any difference,

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.