I am trying to read .gz files in logstash input plugin but I can't read gunzip files in logstash. When I try to read those log files it throws error message like this,
A plugin had an unrecoverable error. Will restart this plugin. Plugin: <LogStash::Inputs::File path=>["/test.txt"], start_position=>"beginning", sincedb_path=>"/dev/null", codec=><LogStash::Codecs::GzipLines charset=>"UTF-8">, stat_interval=>1, discover_interval=>15, sincedb_write_interval=>15, delimiter=>"\n">
Error: Object: application.log.2018-05-14-01.eradar-data-service-prod-1e-5af1c225.us-east-1.amazon.com.gz is not a legal argument to this wrapper, cause it doesn't respond to "read". {:level=>:error}
and also tried path => "/logfile.gz" directly but both are not working it throws same error message.
How to solve this problem, please share your solutions. I refered all the similar questions but none of the solutions solve my issue.
When you specify a path that matches a file, Logstash will attempt to ingest that file. Since you are giving a path to a plain-text file, and it is trying to read it with gzip, it fails. You need to give it a glob-style path that matches the files you want to ingest.
The file input at v4.1.X has test file fixtures and test that verify the code can read gz files - these fixtures, test and the actual zipfile reading code are identical to the S3 input gz reading implementation.
You are experiencing a different outcome - perhaps because you have some differences in your setup. You will need to uncover what these are before anyone can help.
If the LS logs show some errors or logging lines to do with filewatch.readmode.handlers.readzipfilethen post them here.
Have you tested a fresh file gzipped with tar cvzf somefile.gz /some/pathto/somefile.x?
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.