No commit activity in last 3 years
No release in over 3 years
Dictionary based map filter for Fluentd
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0.9.2
~> 3.1

Runtime

>= 1.0, < 2
 Project Readme

Dictionary based map filter for Fluentd

Map field to other value with dictionary

Installation

Use RubyGems:

gem install fluent-plugin-dict-map

Configuration

Use @type dict_map in <filter>.

<filter pattern>
  @type dict_map
  key_name level
  dictionary {"I":"INFO","W":"WARN","E":"ERROR"}
</filter>

For example, if following record is passed,

{"msg":"hello!","level":"I"}

then you got filtered record like below:

{"msg":"hello!","level":"INFO"}

key_name

The target key name.

destination_key_name

The destination key name for mapped result. If not specified, the value is overwritten in key_name.

Example:

# configuration
destination_key_name mapped
# filtered record
{"msg":"hello!","level":"I","mapped":"INFO"}

default_value

This value is used when incoming value is missing in the dictionary. If not specified, value mapping doesn't happen.

# configuration
default_value UNKNOWN
# incoming record
{"msg":"hello!","level":"Z"}
# filtered record
{"msg":"hello!","level":"UNKNOWN"}

dictionary

The json dictionary for value mapping.

dictionary_path

Use json file instead of in-place dictionary parameter. This is useful for large dictionary. File ext must be json.

Example:

dictionary_path /path/to/dict.json

Copyright

Author Masahiro Nakagawa
Copyright Copyright (c) 2018- Masahiro Nakagawa
License Apache 2 License