Skip to content

mumoshu/fluent-plugin-datadog-log

Repository files navigation

fluent-plugin-datadog-log is an output plugin for fluentd which sends logs to Datadog.

<img src=“badge.fury.io/rb/fluent-plugin-datadog-log.svg” alt=“Gem Version” /> <img src=“” alt=“Build Status” />

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.

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.

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 2017 Yusuke KUOKA All rights reserved.

License

Apache License, Version 2.0

About

Sends logs to Datadog Log Management: A port/translation of https://github.com/DataDog/datadog-log-agent to a Fluentd plugin

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages