How do I force rebuild log's data in filebeat 5

周宏成 picture 周宏成 · Jan 17, 2017 · Viewed 13.9k times · Source

I have filebeats 5.x ship logs to logstash.

How do I reset the “file pointer” in filebeat

This is a similar problem to

I cleaned all elasticsearch's data, delete the /var/lib/filebeat/registry. but filebeat is only shipping the new line.

change the registry_file is invalid, the file's offset saved to new file (delete file is the same problem) filebeat.registry_file: registry

Answer

Yasir picture Yasir · Sep 12, 2017
  1. Stop filbeat service.
  2. Rename the register file - usually found in /var/lib/filebeat/registry
  3. Start filbeat service.

sudo service filbeat stop

mv /var/lib/filebeat/registry /var/lib/filebeat/registry.old

sudo service filbeat start