Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log duplication when set follow_inodes true #3818

Closed
wangchaoforever opened this issue Jul 15, 2022 · 1 comment
Closed

Log duplication when set follow_inodes true #3818

wangchaoforever opened this issue Jul 15, 2022 · 1 comment

Comments

@wangchaoforever
Copy link

wangchaoforever commented Jul 15, 2022

Describe the bug

I config my nginx rotate every hour. I used fluentd to collect nginx access log to kafka for several month. It works fine.
But it collected log repeatedly yesterday when the log rotation. The fluentd's log show the detected rotation of the same log for two times.

To Reproduce

It's accidental

Expected behavior

I know the parameter which named follow_inodes can avoid such log duplication.But the log duplication happened when fluentd running for 3 months.

Your Environment

- Fluentd version: 1.14.3
- TD Agent version: 4.1.1
- Operating system: CentOS Linux release 7.9.2009 (Core)
- Kernel version: 3.10.0-1160.62.1

Your Configuration

<source>
    @type tail
    path  /xxx/xxx/xxx/xxx/xxx/*.log*
    exclude_path ["/xxx/xxx/xxx/xxx/xxx/*.gz"]
    pos_file /xxx/xxx/position/xxx.log.pos
    path_key log_path
    read_from_head true
    follow_inodes true
    enable_stat_watcher false
    rotate_wait 10
    tag xxx
    refresh_interval 30
    limit_recently_modified 3600
    read_lines_limit 1000
    multiline_flush_interval 1s
    emit_unmatched_lines false
    read_bytes_limit_per_second 10485760
    <parse>
      @type regexp
      expression /^(?<message>.*)$/
    </parse> 
  </source>

Your Error Log

2022-07-14 19:01:01 +0800 [info]: #1 detected rotation of /xxx/xxx/xxx/xxx/xxx/access.log; waiting 10.0 seconds
2022-07-14 19:01:01 +0800 [info]: #1 following tail of /xxx/xxx/xxx/xxx/xxx/access.log
2022-07-14 19:01:01 +0800 [info]: #1 detected rotation of /xxx/xxx/xxx/xxx/xxx/access.log; waiting 10.0 seconds
2022-07-14 19:01:11 +0800 [info]: #1 following tail of /xxx/xxx/xxx/xxx/xxx/access.log-20220714-1657796461

Additional context

No response

@ashie
Copy link
Member

ashie commented Aug 10, 2022

Duplicate of #3532

@ashie ashie marked this as a duplicate of #3532 Aug 10, 2022
@ashie ashie closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants