repeatedly / fluent-plugin-beats

Fluentd plugin for Elastic beats
Apache License 2.0
45 stars 12 forks source link

Fluent cant't start with beats in config #11

Closed error0x1 closed 5 years ago

error0x1 commented 6 years ago

If I try use beats plugin, my Fluent cant't start

td-agent.conf

<match td.*.*>
  @type tdlog
  @id output_td
  apikey YOUR_API_KEY

  auto_create_table
  <buffer>
    @type file
    path /var/log/td-agent/buffer/td
  </buffer>

  <secondary>
    @type file
    path /var/log/td-agent/failed_records
  </secondary>
</match>

<source>
    @type beats
    port 1111
    bind 0.0.0.0
</source>

In log I have it:

2018-07-19 00:34:01 +0300 [warn]: [output_td] secondary type should be same with primary one primary="Fluent::Plugin::TreasureDataLogOutput" secondary="Fluent::Plugin::FileOutput"
2018-07-19 00:34:01 +0300 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"
2018-07-19 00:34:01 +0300 [error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Duplicated plugin id `output_td`. Check whole configuration and fix it."
2018-07-19 00:34:01 +0300 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"
2018-07-19 00:34:01 +0300 [warn]: [output_td] secondary type should be same with primary one primary="Fluent::Plugin::TreasureDataLogOutput" secondary="Fluent::Plugin::FileOutput"
2018-07-19 00:34:02 +0300 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"
2018-07-19 00:34:02 +0300 [error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Duplicated plugin id `output_td`. Check whole configuration and fix it."
2018-07-19 00:34:02 +0300 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"
2018-07-19 00:34:02 +0300 [warn]: [output_td] secondary type should be same with primary one primary="Fluent::Plugin::TreasureDataLogOutput" secondary="Fluent::Plugin::FileOutput"
2018-07-19 00:34:02 +0300 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"
2018-07-19 00:34:02 +0300 [error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Duplicated plugin id `output_td`. Check whole configuration and fix it."

What is it and how fix it?

repeatedly commented 5 years ago

This is not beat plugin issue.

Duplicated plugin id output_td. Check whole configuration and fix it."

Error said the cause. You had multiple @id output_td in your configuration.

shadjiiski commented 3 years ago

Correct me if I am wrong, but there is a single @id output_td in the shared configuration.

I just had a similar problem with fluent-plugin-kubernetes_metadata_filter-2.2.0:

2021-04-08 08:21:37 +0000 [info]: parsing config file is succeeded path="/etc/fluent/fluent.conf"
2021-04-08 08:21:37 +0000 [info]: parsing config file is succeeded path="/etc/fluent/fluent.conf"
2021-04-08 08:21:37 +0000 [error]: config error file="/etc/fluent/fluent.conf" error_class=Fluent::ConfigError error="Duplicated plugin id `filter_kubernetes_metadata`. Check whole configuration and fix it."

Commenting out the @id in the configuration revealed that there is actually another error:

Apr 08 08:27:42 sc1-10-182-190-194.eng.vmware.com fluentd[1913]: /usr/lib/ruby/2.5.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'i18n' (< 2, >= 0.7) among 78 total gem(s) (Gem::MissingSpecError)

Fixing the dependency conflict resolved my issue - the configuration worked with the @id uncommented. Not sure if the actual error was hidden by the plugin or by fluentd itself (tested with fluentd v1.6.3). Judging by the logs, when it was broken, the config was parsed two times as opposed to a single time when the issue was resolved.

123BLiN commented 2 years ago

should not be closed as this is a bug in logging