No commit activity in last 3 years
No release in over 3 years
Output filter plugin to rewrite Collectd JSON output to nested json
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0.9.2

Runtime

>= 0.10.17
 Project Readme

Output filter plugin to rewrite Collectd JSON output to nest into a nested json

Rewrites the message coming from Collectd to store as a nested json. Can be used in Elasticsearch to display metrics.

Installation

Use RubyGems: If you use td-agent

td-agent-gem install fluent-plugin-collectd-nest

If you use fluentd

gem install fluent-plugin-collectd-nest

Configuration

<match pattern>
  type collectd_nest
</match>

If the following record is passed:

{"time":1000, "host":"host_v", "interval":5, "plugin":"plugin_v", "plugin_instance":"plugin_instance_v",
 "type":"type_v", "type_instance":"type_instance_v", "values":["v1", "v2"], "dsnames":["n1", "n2"],
 "dstypes":["t1", "t2"]}

then you get new record:

{"host":"host_v",
 "collectd": {
   "time":1000, "interval":5, "plugin":"plugin_v", "plugin_instance":"plugin_instance_v",
   "type":"type_v", "type_instance":"type_instance_v", "dstypes":"t1",
   "plugin_v": {"type_v": {"n1":"v1", "n2":"v2"}}
 }
}

Empty values in "plugin", "plugin_instance", "type" or "type_instance" will not be copied into the new tag name

If a records has only one value like :

{"time":1000, "host":"host_v", "interval":5, "plugin":"plugin_v", "plugin_instance":"plugin_instance_v",
 "type":"type_v", "type_instance":"type_instance_v", "values":["v1"], "dsnames":["n1"],
 "dstypes":["t1"]}

then the new record will be:

{"host":"host_v",
 "collectd": {
   "time":1000, "interval":5, "plugin":"plugin_v", "plugin_instance":"plugin_instance_v",
   "type":"type_v", "type_instance":"type_instance_v", "dstypes":"t1",
   "plugin_v": {"type_v":"v1"}
 }
}

WARNING

  • This plugin was written to deal with a specific use-case, might not be the best fit for everyone. If you need more configurability/features, create a PR

Copyright

Author Viaq
License MIT License