Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master
Failed to load latest commit information.
lib/fluent/plugin tweak
test tweak
.gitignore first commit
.travis.yml Version bump 0.0.3
ChangeLog Version bump 0.0.2
Gemfile first commit
LICENSE first commit
README.rdoc Version bump 0.0.3
Rakefile first commit
fluent-plugin-filter.gemspec Version bump 0.0.3
sample.conf first commit

README.rdoc

fluent-plugin-filter

Component

FilterOutput

Filtering messages by simple allow/deny rules.

Installation

Add this line to your application's Gemfile:

gem 'fluent-plugin-filter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fluent-plugin-filter

Configuration

FilterOutput

Filter out messages contains {status : 404} :

<match accesslog.**>
  type filter
  all allow
  deny status: 404
</match>
<match filtered.**>
  type stdout
</match>

in above configuration, {status: 404} is filtered out and {status: 200}, {status: 303}, {status: 401} passed. Messages passing filter are add_prefix (default filtered.)

So you catch “filtered” tag and do next process.

You can use int, float, string, regexp in value.

Parameters

all <allow|deny>

Specify basic policy.

allow field:<Pattern> / deny field:<Pattern>

Specify each field policies. If a value for the field matches the pattern, the allow or deny rule is applied.

Pattern := <String|Integer|Float|Regexp>

Patten is parsed by following rules.

  • Integer: a value consisted of degits without “.”. e.g. status:200, price:10000

  • Float: a value consisted of degits with “.” (if you force the value float, set 200.0). e.g. average:145.0

  • Regexp: a value starting with “/” and end with “/”. e.g. path://user/d+/

    • thx @mmacvicar !

  • String: a value unmatched below rule or enveloped with " or '.

Contributing

  1. Fork it

  2. Create your feature branch (`git checkout -b my-new-feature`)

  3. Commit your changes (`git commit -am 'Added some feature'`)

  4. Push to the branch (`git push origin my-new-feature`)

  5. Create new Pull Request

Something went wrong with that request. Please try again.