Thank you very much.
I had read the change log too.
I try to read the in_tail.rb.
I think I know how the tail plugin work.
The tail plugin save the last read pos and the inode to the pos_file.
The pos_file has three field: file name, pos, inode.
The TimerWatcher will try to read the log file every second, if inode
or the size change ,will rotate to the new log file.
Then try to read the the log file(nonblok), parse the lines and send
them to the Engine.
At last, save the new pos into the pos_file.
I found some thing may be wrong:
use tail plugin to watch "log.1", and set pos_file log.pos
<source>
type tail
path log.1
tag debug.test
pos_file log.pos
</source>
# cat log.pos
# log.1 0000000000000140 002c1727
We can find the inode of log.1.
then
# rm log.1 && cat sample.log >> log.1
# ls -i log.1
# 2889504 log.1 (2889504 == 0x2c1720 != 0x2c1727)
We will find that the log.1 inode have changed ,but in log.pos, the
inode field is still the old value!
On Apr 20, 8:23 am, 西田圭介(BizMobile) <
knish...@bizmobile.co.jp> wrote:
> Hi hengyunabc,
>
> I don't know much about the implementation, but here are some notes
> from the recent releases:
>
> | Released Fluentd v0.10.12. This is a minor bug fix release for everyone.
> |
> | * I re-designed in_tail plugin to follow all files including
> symbolic links correctly.
> | New implementation considers log rotation. it remains to read the
> rotated old file for
> | several seconds since applications may take time to switch the log file.
> | You can control the wait time using 'rotate_wait 5s' parameter.
>
> | Released Fluentd v0.10.13. This is a bug fix release for all user of v0.10.12
> |
> | * Rewrote in_tail [issue #40]
> | On v0.10.12, the tail plugin has a problem that consumes all
> resources of one CPU core.
> | Now it's fixed and the new design is slightly efficient than the old design.
>
> Hope this helps.
>
> Chees,
> Keisuke
>
> 2012/4/19 hengyunabc <
hengyun...@gmail.com>: