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

Unable to read and output journal files from default path var/log/journal #107

Open SuyashTandon opened 1 year ago

SuyashTandon commented 1 year ago

Hi Team,

I'm using this plugin using default directory (i.e. var/log/journal)

<source>
  @type systemd
  tag kubelet
  path /var/log/journal/*.journal
  read_from_head true

  <storage>
    @type local
    path /var/log/fluentd-journald-kubelet-cursor.json
  </storage>

  <entry>
    fields_strip_underscores true
    fields_lowercase true
  </entry>
</source>

I am trying to output these logs to check whether its working or not by using:

<match kubelet**>
  @type stdout
</match>

Expected result is Logs should be present with matching "kubelet" tag, but I am not able to get any logs. There are '.journal' files in my var/log/journal directory.

Thanks

errm commented 1 year ago

I think the issue could be providing a glob for .journal files rather than a directory name.

Could you try with path /var/log/journal

If this is the case perhaps we can add an error message in the case that the configured path is not a directory ...