No commit activity in last 3 years
No release in over 3 years
fluentd plugin to pickup sample data from matched massages
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

~> 3.1.0
>= 0.14.12, < 2
 Project Readme

fluent-plugin-sampling-filter

This is a Fluentd plugin to sample matching messages to analyse and report messages behavior and emit sampled messages with modified tag.

  • sampling rate per tags, message field, or all

Requirements

fluent-plugin-sampling-filter fluentd ruby
>= 1.0.0 >= v0.14.0 >= 2.1
< 1.0.0 < v0.14.0 >= 1.9

Configuration

SamplingFilter

This filter passes a specified part of whole events to following filter/output plugins:

<source>
  @type any_great_input
  @label @mydata
</source>

<label @mydata>
  <filter **>
    @type sampling
    sample_unit all
    interval 10    # pass 1/10 events to following plugins
  </filter>

  <match **>
    @type ...
  </match>
</label>

Sampling is done for all events, but we can do it per matched tags:

<source>
  @type any_great_input
  @label @mydata
</source>

<label @mydata>
  <filter **>
    @type sampling
    interval 10
    sample_unit tag # 1/10 events for each tags
  </filter>

  <match **>
    @type ...
  </match>
</label>

We can also sample based on a value in the message

<source>
  @type any_great_input
  @label @mydata
</source>

<label @mydata>
  <filter **>
    @type sampling
    interval 10
    # pass 1/10 events per user given events like: { user: { name: "Bob" }, ... }
    sample_unit $.user.name
  </filter>

  <match **>
    @type ...
  </match>
</label>

minimum_rate_per_min option(integer) configures this plugin to pass events with the specified rate even how small is the total number of whole events.

sample_unit option(string) configures this plugin to sample data based on tag(default), 'all', or by field value using the record accessor syntax.

SamplingFilterOutput

NOTE: This plugin is deprecated. Use filter plugin instead.

Pickup 1/10 messages about each tags(default: sample_unit tag), and add tag prefix sampled.

<match **>
  @type sampling_filter
  interval 10
  add_prefix sampled
</match>

<match sampled.**>
  # output configurations where to send sampled messages
</match>

Pickup 1/100 messages of all matched messages, and modify tags from input.** to output.**

<match input.**>
  @type sampling_filter
  interval 100
  sample_unit all
  remove_prefix input
  add_prefix output
</match>

<match sampled.**>
  # output configurations where to send sampled messages
</match>

TODO

  • patches welcome!

Copyright

  • Copyright
    • Copyright (c) 2012- TAGOMORI Satoshi (tagomoris)
  • License
    • Apache License, Version 2.0