Sha256: 251afe0e5c913115750e7823515c52c31d396f83745ed63790b44d6fce776c7d

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

# fluent-plugin-calc [![Build Status](https://secure.travis-ci.org/sonots/fluent-plugin-calc.png?branch=master)](http://travis-ci.org/sonots/fluent-plugin-calc) [![Dependency Status](https://gemnasium.com/sonots/fluent-plugin-calc.png)](https://gemnasium.com/sonots/fluent-plugin-calc) [![Coverage Status](https://coveralls.io/repos/sonots/fluent-plugin-calc/badge.png?branch=master)](https://coveralls.io/r/sonots/fluent-plugin-calc)

Fluentd plugin to calc messages.

## Configuration

    <match foo.**>
      type calc
      interval 5s
      add_tag_prefix calc

      sum .*_count$
      max .*_max$
      min .*_min$
      avg .*_avg$
    </match>

Assuming following inputs are coming:

    foo.bar: {"4xx_count":1,"5xx_count":2","reqtime_max":12083,"reqtime_min":10,"reqtime_avg":240.46}
    foo.bar: {"4xx_count":4,"5xx_count":2","reqtime_max":24831,"reqtime_min":82,"reqtime_avg":300.46}

then output bocomes as belows:

    calc.foo.bar: {"4xx_count":5,"5xx_count":4","reqtime_max":24831,"reqtime_min":82,"reqtime_avg":270.46}

## Parameters

- sum, min, max, avg

    Calculation. Specify input keys by a regular expression

- interval

    The interval to calculate in seconds. Default is 5s. 

- tag

    The output tag name. Required for aggregate `all`. 

- add_tag_prefix

    Add tag prefix for output message. 

- aggragate
    
    Calculate by each `tag` or `all`. The default value is `tag`.

## ChangeLog

See [CHANGELOG.md](CHANGELOG.md) for details.

## ToDo

Get the number of denominator to calculate `avg` from input json field. 

## 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](../../pull/new/master)

## Copyright

Copyright (c) 2013 Naotoshi SEO. See [LICENSE](LICENSE) for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-calc-0.0.2 README.md