bpaquet/node-logstash — pull request #24 by fenguin (2013-03-13 02:01:55+00:00)
Title: fdTailer.current_index has string type when start_index is defined on file input

Defining an input per https://github.com/bpaquet/node-logstash#file with `start_index` set causes it to be typecast as a string when parsed, and so when fdTailer is initialized, its `start_index` also has string type. As can be imagined, adding `buffer_size` each read then concatenates it to `fdTailer.start_index` instead of adding it, making its value ever-increasing lengths of `102410241024...`

This causes two problems:
(1) When any watched file changes, the last data never matches, causing reading to restart
(2) When the `--db_file` flag is set, the JSON object written to that file also has `index=102410241024...`

Fixed by converting `start_index` to an integer when it is defined and used.