Add exclude path dynamically to fluent.conf

502 views
Skip to first unread message

BIJAY PARIDA

unread,
Oct 7, 2018, 10:13:15 AM10/7/18
to Fluentd Google Group
Hi,

Is it possible to dynamically provide the exclude path in the fluentd.conf?

Existing conf
===========

<source>

  @type tail

  path /var/log/containers/*.log

  exclude_path ["/var/log/containers/*fluent*"]

  pos_file /var/log/containers/containers-log.pos

  tag kubernetes.*

  read_from_head true

  <parse>

    @type json

    time_format %Y-%m-%dT%H:%M:%S

  </parse>

</source>



Proposed conf

===========


<source>

  @type tail

  path /var/log/containers/*.log

  echo "exclude_path `cat exclude_path`"

  #OR

  #exclude_path `cat exclude_path`

  pos_file /var/log/containers/containers-log.pos

  tag kubernetes.*

  read_from_head true

  <parse>

    @type json

    time_format %Y-%m-%dT%H:%M:%S

  </parse>

</source>



Is this going to work? If not how to achieve this?


Thanks
Bijay

BIJAY PARIDA

unread,
Oct 7, 2018, 10:15:46 AM10/7/18
to Fluentd Google Group
Missed to add that.

exclude_path=["/var/log/containers/*fluent*"]

But not sure where add this file.

Mr. Fiber

unread,
Oct 9, 2018, 4:17:54 PM10/9/18
to Fluentd Google Group

> Is it possible to dynamically provide the exclude path in the fluentd.conf?

If your 'dynamically' mean configuration parsing phase, you can use embbeded ruby code feature

--
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.

BIJAY PARIDA

unread,
Oct 10, 2018, 3:03:22 AM10/10/18
to Fluentd Google Group
Thanks a lot Masahiro. I followed the similar approach and able to achieve the expected result.

-Bijay
Reply all
Reply to author
Forward
0 new messages