No commit activity in last 3 years
No release in over 3 years
fluentd parser plugin to be able to use Grok patterns
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10.4.2

Runtime

~> 0.10.17
~> 0.11.0
 Project Readme

Fluent::Plugin::grok_pure::Parser

This fluentd parser plugin adds a parse format grok_pure which allows using any Grok pattern. It uses the jls-grok ruby gem, so it supports all Grok features, including type coercion.

Installation

Install the plugin by running:

fluent-gem install fluent-plugin-grok_pure-parser

Usage

<source>
  type tail
  path /path/to/log
  tag foo.log

  format grok_pure
  grok_pattern %{HAPROXYHTTP}
  grok_pattern_path /etc/grok_patterns
</source>

Setting format to grok_pure enables the Grok parser. The two main configuration options are grok_pattern_path, which must be the path to a directory that contains grok patterns, and grok_pattern, which is the pattern used to match and format the record. All named grok patterns will end up as keys in the resulting record.

The following standard format options are also supported:

  • time_key: Sets the name of the grok capture group that contains the log timestamp
  • time_format: Sets the format of the log timestamp, for parsing
  • type coercion via the TypeConverter mixin (no official documentation available yet)

Grok patterns can generally be of the form of %{PATTERN_NAME}, %{PATTERN_NAME:CAPTURE_NAME} or %{PATTERN_NAME:CAPTURE_NAME:type_coercion}. See the Logstash Grok documentation for more 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