Git Product home page Git Product logo

fluent-plugin-stats-notifier's Introduction

fluent-plugin-stats-notifier Build Status

Fluentd plugin to calculate statistics and then thresholding

Configuration

Example 1

Get statistics on messages

<match foo.**>
  type stats_notifier
  tag notifier
  interval 5
  target_key 4xx_count
  greater_equal 4
  stats max # default
  store_file /path/to/store_file.dat
</match>

Assuming following inputs are coming:

foo.bar1: {"4xx_count":1,"foobar":2"}
foo.bar1: {"4xx_count":6,"foobar":2"}

then this plugin emits an message because the max of 4xx_count is greater than or equal to the specified value 4. Output will be as following:

notifier: {"4xx_count":6.0}

Example 2

Get statistics among tags

<match foo.**>
  type stats_notifier
  tag notifier
  interval 5
  target_key 4xx_count
  greater_equal 4
  aggregate all # default
  aggregate_stats max # default
  store_file /path/to/store_file.dat
</match>

Assuming following inputs are coming:

foo.bar1: {"4xx_count":1,"foobar":2"}
foo.bar2: {"4xx_count":6,"foobar":2"}

then this plugin emits an message because the max of 4xx_count is greater than or equal to the specified value 4. Output will be as following:

notifier: {"4xx_count":6.0}

Combined Example

<match foo.**>
  type stats_notifier
  tag notifier
  interval 5
  target_key 4xx_count
  greater_equal 4
  stats max # default
  aggregate all # default
  aggregate_stats max # default
  store_file /path/to/store_file.dat
</match>

Assuming following inputs are coming:

foo.bar1: {"4xx_count":1,"foobar":2"}
foo.bar1: {"4xx_count":8,"foobar":2"}
foo.bar2: {"4xx_count":6,"foobar":2"}

Output will be as following:

notifier: {"4xx_count":8.0}

Parameters

  • target_key (required)

    The target key in the event record.

  • interval

    The interval time of calculation and bounding. Default is 60.

  • less_than

    A less than threshold value, that is, emit if target_key value < specified value.

  • less_equal

    A less than or eqaul threshold value, that is, emit if target_key value <= specified value.

  • greater_than

    A greater than threshold value, that is, emit if target_key value > specified value.

  • greater_equal

    A greater than or eqaul threshold value, that is, emit if target_key value >= specified value.

  • stats

    max, avg, min, sum can be specified. Default is max.

  • aggregate_stats

    Work only with aggregate all. max, avg, min, sum can be specified. Default is max.

  • compare_with

    Obsolete. Use aggregate_stats.

  • tag

    The output tag name. Required for aggregate all.

  • add_tag_prefix

    Add tag prefix for output message. Required for aggregate tag.

  • remove_tag_prefix

    Remove tag prefix for output message.

  • add_tag_suffix

    Add tag suffix for output message.

  • remove_tag_suffix

    Remove tag suffix for output message.

  • aggragate

    Do calculation for each tag or all. The defaultis all.

  • store_file

    Store internal data into a file of the given path on shutdown, and load on starting.

ChangeLog

See CHANGELOG.md for details.

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

Copyright (c) 2013 Naotoshi Seo. See LICENSE for details.

fluent-plugin-stats-notifier's People

Contributors

sonots avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

kozmagabor

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.