I am facing an issue with logstash that it read the log from begin even after it has loaded the log file already. It happens only when i restart the logstash. Inside the .sincedb file the contents are :
The format of the sincedb file is documented here. The file input does not track files by name, it uses the inode, which is unique to the device. The problem is that your device number has changed -- the 38 has become a 39. Is this a network mount? Either way, the way to control the minor device number is going to be OS and file system specific.
Thanks Badger for quick answer. Yes the log is stored on an NFS.
The logstash machine got rebooted but there was no change on NFS side.
Can you please suggest some workaround to get rid of this minor device number issue ?
The document suggest not to use Read mode for remote FS, what is difference between read & tail mode? It is not very clear from the documentation.
No, switching mode will not help. It thinks it is a different inode, and therefore a different file.
In read mode it is assumed that the file has been written to, so the file input can read the file and not have to come back to it. In tail mode it is assumed that the file is going to be written to in the future, so the file input has to constantly monitor the length of the file to see if it has changed.
one last query on this rather a workaround :
With every restart of logstash machine which tends to change the minor or major device numbers, if i find these numbers to be different than those prior to stop of logstash, can i edit the .sincedb to make major & minor numbers aligned keeping rest as same. All this will be done while logstash is stopped. Will that have any side effect ? I am just trying to find out a workaround for this blocking issue. Please suggest
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.