fluent-plugins-nursery / fluent-plugin-systemd

This is a fluentd input plugin. It reads logs from the systemd journal.
Apache License 2.0
153 stars 43 forks source link

Plugin @id or path for <storage> required when 'persistent' is true #40

Closed Globegitter closed 7 years ago

Globegitter commented 7 years ago

I have a config like:

    <source>
      @type systemd
      filters [{ "_SYSTEMD_UNIT": "kubelet.service" }]
      pos_file /var/log/gcp-journald-kubelet.pos
      read_from_head true
      tag kubelet
      @id in-systemd-kubelet
      <storage>
        @type local
        @id in-systemd-kubelet-storage
        persistent true
      </storage>
    </source>

and getting the following error:

2017-09-13 09:18:25 +0000 [error]: config error file="/etc/fluent/fluent.conf" error_class=Fluent::ConfigError error="Plugin @id or path for <storage> required when 'persistent' is true"

If I remove the @id from the storage section and add the path it all works fine.

errm commented 7 years ago

If you set persistent true it is required to give a path to the file used to store the cursor...

A working example is given in the README, could you explain what you expect to happen with this configuration? since it just looks invalid to me.

cosmo0920 commented 7 years ago

How about the following configurations? Because storage plugin does not handle file path with @id. Instead we can specify it storage directive's attributes.

    <source>
      @type systemd
      filters [{ "_SYSTEMD_UNIT": "kubelet.service" }]
      pos_file /var/log/gcp-journald-kubelet.pos
      read_from_head true
      tag kubelet
      @id in-systemd-kubelet
      <storage in-systemd-kubelet-storage>
        @type local
        persistent true
      </storage>
    </source>
Globegitter commented 7 years ago

@errm I was just confused because of the error message saying @id or path so I expected I was able to set @id but @cosmo0920 gave the answer it seems - thanks :)