Skip to content

Script to check if Fluentd in_tail plugin is collecting target files correctly.

License

Notifications You must be signed in to change notification settings

clear-code/fluent-tail_checker

Repository files navigation

fluent-tailcheck

fluent-tailcheck is a command for Fluentd.

This command checks whether in_tail plugin is collecting logs properly. For example, this command verifies whether a known critical log missing issue is occurring.

Known critical log missing issues:

  • fluent/fluentd#3614
    • In case follow_inodes false (default setting), collection of a file may stop and continue to stop after log rotation.
    • Fixed since Fluentd v1.16.3 (fluent-package v5.0.2, td-agent v4.5.2).
  • fluent/fluentd#4190
    • In case follow_inodes true, collection of a file may stop and continue to stop after log rotation.
    • Fixed since Fluentd v1.16.2 (fluent-package v5.0.0, td-agent v4.5.1).

This command allows you to check whether these issues are occurring on your Fluentd.

Requirements

fluent-tailcheck fluentd td-agent fluent-package
all versions >= v1.0 >= 3.1.1 >= 5.0.0

Installation

Usage

Help

$ fluent-tailcheck --help

Version

$ fluent-tailcheck --version

Check pos files

You can specify a path of a pos file to check:

$ fluent-tailcheck /var/log/td-agent/pos/secure

You can specify multiple paths:

$ fluent-tailcheck /var/log/td-agent/pos/secure /var/log/td-agent/pos/message

You can use wildcards:

$ fluent-tailcheck /var/log/td-agent/pos/*

If you use follow_inodes, then you must specify --follow-inodes option. (If you have both settings that use follow_inodes and those that do not, please run the command separately.)

$ fluent-tailcheck --follow-inodes /var/log/td-agent/pos/secure

You can change the minimum ratio of collection of each target log file by specify --ratio DECIMAL. By default (0.5), the command detects log files that have not been collected up to 50% of the filesize. Please see Collection ratio check for details.

$ fluent-tailcheck --ratio 0.7 /var/log/td-agent/pos/secure

Permission

fluent-tailcheck requires read permission to the specified pos files and the target log files.

Please use sudo (on Linux-like) or a terminal with administrative privileges (on Windows).

$ sudo fluent-tailcheck /var/log/td-agent/pos/secure

Automation

It would be a good idea to run this command periodically to make sure in_tail works properly.

If any anomaly is detected, the command exits with an error (with a non-zero status). You can use the exit code for the automation.

Result examples

Feature

Development

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/clear-code/fluent-tail_checker.

Copyright

  • Copyright 2025 Daijiro Fukuda
  • License
    • Apache License, Version 2.0

About

Script to check if Fluentd in_tail plugin is collecting target files correctly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published