So i use filebeat 6.4.0. And i produce 1.000.000 lines with log4j2 to a main.log. Then i execute filebeat to read this main.log and writes the output to file. But filebeat dont have 1.000.000 lines but fewer. Why that?
#======== File Output =========================================================
output.file: #Boolean flag to enable or disable the output module.
enabled: true
#Path to the directory where to save the generated files. The option is #mandatory.
path: /home/steve/Desktop/FilebeatOutput/
#Name of the generated files. The default is filebeat and it generates
filename: siebel.txt
This look like a strange behavior, I have a few questions.
How many events are not present?
If you diff the file are the missing events located in once place?
Did you start the tests multiple times with the same target file, if the file didn't not change inode, Filebeat would keep an offset or previous run in the data/registry file and will start reading from that and potentially miss events.
From the 1.000.000 lines, filebeat output files (which is 7 files with 10MB size each), have from 79117 line until 1.000.000 line. That means that the line 0 until 79116 are missing from filebeat.
The events (actually are just lines with a simple txt and a counter) are located only in one file, called main.log. Then, filebeat produces 7 output files, with each file size almost 10MB.
Each time i reproduce the same process, i always delete the data/registry file. And each time, always delete the target file (main.log).
@Steve1 This expected behavior, the file output rotates and replace files, by default Filebeat only keeps 7 files and will overwrite older files.
The maximum number of files to save under path. When this number of files is reached, the oldest file is deleted, and the rest of the files are shifted from last to first. The number of files must be between 2 and 1024. The default is 7.
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.