Datadog plugin for fluentd¶ ↑
fluent-plugin-datadog-log is an output plugin for fluentd which sends logs to Datadog.
<img src=“https://badge.fury.io/rb/fluent-plugin-datadog-log.svg” alt=“Gem Version” /> <img src=“https://secure.travis-ci.org/mumoshu/fluent-plugin-datadog-log.png” alt=“Build Status” />
Installation¶ ↑
This gem is hosted at RubyGems.org and can be installed using:
$ gem install fluent-plugin-datadog-log
kube-fluentd docker image would also include the gem.
Configuration¶ ↑
To send logs to Datadog, specify type datadog
in a match clause of your fluentd configuration file, for example:
<match **> type datadog api_key <your api key> service myservice source mysource source_category mysourcecategory logset mylogset </match>
‘api_key` can be omitted when the env var named DD_LOG_API_KEY is set instead.
Add ‘log_level debug` to enable debug logging which dumps every payload sent to Datadog.
Testing Datadog Connectivity within irb¶ ↑
cd path/to/fluent-plugin-datadog-log bundle exec irb -r datadog/lib c = Datadog::Log::Client.new(api_key:ENV['DD_LOG_API_KEY'],hostname:'myhost'); pl = c.send_payload(msg: 'foobar', source: 'myapp', source_category: 'stdout', service: 'irb', tags: %w|foo=bar|); puts pl
Copyright¶ ↑
- Copyright
-
Copyright 2017 Yusuke KUOKA All rights reserved.
- License
-
Apache License, Version 2.0