fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

[in_tail] tail multiple logs file DailyRollingFileAppender Logback

Open nganbph10804 opened this issue 1 year ago • 2 comments

I have read issue #544 and realize my problem is related that.

  • LogBack also uses a RollingFileAppender configure to append a new file every day:

image

  • For disaster recovery, i have to configure fluentd tail last 7 days of logfile:
<source>
  @type tail
    // i want tails current logback file and last 6 days before today
  path /var/log/tomcat/Application.log,
   // last 6 days before file
   /var/log/Application.log.2022-09-*
  follow_inodes true
  path_timezone  "Asia/Tokyo"
  time_format "%Y-%m-%d"
  pos_file /var/log/tomcat/log.pos
  tag tail.multiple
  <parse>
    @type json
  </parse>
</source>

Describe the solution you'd like

Is there any way to solve my problem ?

Describe alternatives you've considered

N/A

Additional context

No response

nganbph10804 avatar Sep 19 '22 07:09 nganbph10804

@repeatedly Can you give me a hand on this?

nganbph10804 avatar Sep 19 '22 07:09 nganbph10804

No this is not possible as of v1.15.1. Fluentd will just send each log twice with your configuration.

To archive your requirement, Fluentd needs to maintain the complete file history, but it just currently has no such ability.

fujimotos avatar Oct 21 '22 09:10 fujimotos