jordansissel/ruby-filewatch — pull request #34 by michio-nikaido (2014-06-09 21:44:36+00:00)
Title: Add follow_only_path flag to dumb down filewatching to just paths

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