DataDog / fluent-plugin-datadog

Fluentd output plugin for Datadog: https://www.datadog.com
Apache License 2.0
39 stars 26 forks source link

Can't make it work #14

Closed mickey closed 6 years ago

mickey commented 6 years ago

Describe what happened:

Trying to ship logs from Fluentd to Datadog but nothing happens.

Describe what you expected:

My logs to be displayed in the Datadogs Logs web interface :)

Steps to reproduce the issue:

My config is as simple as that:

<source>
  @type http
  port 9191
  format none
</source>

<match test.toto>
  @type stdout
</match>

<match test.toto>
  @type datadog
  @id awesome_agent
  api_key xxxxx
  include_tag_key true
  tag_key 'tag'
  @log_level trace
  max_retries 1
</match>

I tried with the last version of the gem and with master:

ruby '2.4.4'
gem "fluentd", "~> 1.2.1"
gem "fluentd-ui"
gem "fluent-plugin-datadog", git: "git@github.com:DataDog/fluent-plugin-datadog.git"

I'm sending events with:

curl -X POST -d 'json={"message":"hello Datadog from fluentd"}' http://localhost:9191/test.toto

I tried with use_ssl false doesn't work either.

I tried sending logs through:

openssl s_client -connect intake.logs.datadoghq.com:10516

And:

telnet intake.logs.datadoghq.com 10514

And it works!

I'm seeing this output in fluentd:

I might have done something wrong but really can't see it. Any help would be appreciated! Thanks

gregsymons commented 6 years ago

fluentd only sends to the first matching output. Try this config:

<source>
  @type http
  port 9191
  format none
</source>

<match test.toto>
  @type copy
  <store>
    @type stdout
  </store>
  <store>
    @type datadog
    @id awesome_agent
    api_key xxxxx
    include_tag_key true
    tag_key 'tag'
    @log_level trace
    max_retries 1
  </store>
</match>
ajacquemot commented 6 years ago

Thanks @mickey for opening this issue and @gregsymons for providing a solution. Can you confirm that you can see your logs on Datadog now please ? Cheers

mickey commented 6 years ago

Hey sorry for the delay. I tested again by using copy and indeed it works 🙏. Sorry for the wrong report.

Thanks a lot @gregsymons and @ajacquemot. I'm closing the ticket.