How does filebeat keep track of what line it has read?

If I have a log file that are x MB long, and there is a new log entry.
How does FIlebeat know where it should start to read again?
Does it need to retrieve the entire file, or does it open the file from its last known line?

This topic can answer your questions.

https://www.elastic.co/guide/en/beats/filebeat/6.0/how-filebeat-works.html#_how_does_filebeat_keep_the_state_of_files

I have already read that site arkady_renko. But I didn't understand it.

Filebeat stores the last read offset and when opening it will directly jump to this offset.

But does it open the entire file? If the file is located at server B, but filebeat is located at server A. Does it then have to retrieve the entire file ?

In general we don't recommend to read from a remote file system.

What exactly happens I think does more depend on the OS and the Filesystem then Filebeat itself. Filebeat calls seek on the file handler and requests to start reading from that offset.

Thanks ruflin.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.