{tag} placeholder is not working with plugin_id directive

722 views
Skip to first unread message

Sanjay Kumar

unread,
Jan 9, 2019, 5:53:54 AM1/9/19
to Fluentd Google Group
Hello, 

I am trying to use ${tag} as a value for the "plugin_id" directive but it's not working. 

Error is : 

2019-01-09 11:45:18 +0100 [info]: parsing config file is succeeded path="/etc/td-agent/td-agent.conf"

2019-01-09 11:45:18 +0100 [error]: config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Duplicated plugin id `${tag}`. Check whole configuration and fix it."


My td-agent configuration is : 


<source>

  @type forward

  port 24224

</source>



<match test.app1>

  @type copy

  <store>

    @type prometheus

    <metric>

      name fluentd_output_status_num_records_total

      type counter

      desc The total number of outgoing records

      <labels>

        tag ${tag}

        hostname ${hostname}

      </labels>

    </metric>

  </store>

  <store>

   @type file

   @id ${tag}

   path /var/log/td-agent/

   <buffer>

    timekey 1d

    timekey_use_utc true

    timekey_wait 10m

   </buffer>

  </store>

</match>


<match test.app2>

  @type copy

  <store>

    @type prometheus

    <metric>

      name fluentd_output_status_num_records_total

      type counter

      desc The total number of outgoing records

      <labels>

        tag ${tag}

        hostname ${hostname}

      </labels>

    </metric>

  </store>

  <store>

   @type file

   @id ${tag}

   path /var/log/td-agent/

   <buffer>

    timekey 1d

    timekey_use_utc true

    timekey_wait 10m

   </buffer>

  </store>

</match>



Can you please help me to fix this ? 

Mr. Fiber

unread,
Jan 10, 2019, 2:30:19 AM1/10/19
to Fluentd Google Group
> Can you please help me to fix this ? 

No way. I'm not sure why you need dynamic value in plugin_id.
plugin id must be static unique value for identifying plugin in fluentd instance.
Maybe, you misunderstand something about plugin id(@id) parameter.


Masahiro


--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sanjay Kumar

unread,
Jan 10, 2019, 3:24:22 AM1/10/19
to Fluentd Google Group
Hello Masahiro, 

Thanks for your reply.  I don't want the dynamic value, I just wanted the @id to be assigned as tag name, since we are maintaining the unique TAG name, this value should fit right for the @id too. We just want to maintain this standard and avoid the manual work.    

Anyway, if it's not doable then I will configure this manually. 

Regards,
Sanjay.

Mr. Fiber

unread,
Jan 10, 2019, 3:39:24 AM1/10/19
to Fluentd Google Group
> I just wanted the @id to be assigned as tag name, since we are maintaining the unique TAG name,
> this value should fit right for the @id too

In our experiecne, no user use tag for output's @id parameter bacause tag is mainly for event source/tag routing
, not for output. Semantics are totally different.
Deployment tools or something can do it for reducing maintenance cost.

Sanjay Kumar

unread,
Jan 10, 2019, 3:48:35 AM1/10/19
to Fluentd Google Group
Okay, yes. I got it. Thanks for the clarification. 
Reply all
Reply to author
Forward
0 new messages