have a log file containing 2044 lines, but after indexing into Elasticsearch using Logstash, I find only 2043 documents. I suspect that an empty line in the log file might have been skipped by Logstash during indexing.
I'm seeking advice on how to verify if this empty line was indeed ignored by Logstash during processing.
I've checked Logstash logs, but I haven't found specific indications regarding this empty line. Additionally, I've attempted to start Logstash in debug mode, but I'm uncertain what to look for in the logs.
How can I check if an empty line is being skipped by Logstash during indexing into Elasticsearch?
Do you have a rough idea which entry might be being skipped to look in Elasticsearch? Otherwise you could check for messages referencing skipping in the debug logs as you suggest.
OK, so you are running the file input plugin in tail mode, which is the default value. This requires, as shown in the docs I linked to, that each line ends in a newline. Does the last line in the log file end in a newline?
Then that is why it is missing. If you have a static file that is not being appended to you can change to read mode, which should fix this issue. If you are appending you need to make sure every line ends with a newline to avoid this issue.
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.