Skip to content

Conversation

@michio-nikaido
Copy link

I'm putting together a Logstash deployment which involves a number of production servers regularly rsync'ing files to a central log repository. When running Logstash from this central server, it appears that the filewatch code behind the Logstash 'file' input is detecting the updated inode on each rsync and treating the file as new.

The changes here allow a 'follow_only_path' flag to be specified that causes the inode variable to be constructed from the file path rather than the file's inode. This allows the inode variable to remain the same after an rsync updates the file's inode, allowing the @sincedb lookup to file the same entry and continue parsing the file from where it left off

@michio-nikaido
Copy link
Author

Had to do a little special case handling of paths with spaces/carriage returns in them to prevent parsing errors in _sincedb

@wiibaa
Copy link
Contributor

wiibaa commented Feb 26, 2015

@michio-nikaido could you please rebase your PR against current master, the creation of the sincedb_identifier is now in its own method so your code and superb comment should go here please https://github.com/jordansissel/ruby-filewatch/blob/master/lib/filewatch/tail.rb#L110

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

Successfully merging this pull request may close these issues.

2 participants