0

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: ["/test.txt"], start_position=>"beginning", sincedb_path=>"/dev/null", codec=>"UTF-8">, stat_interval=>1, discover_interval=>15, sincedb_write_interval=>15, delimiter=>"\n">

Error: Object: sample.gz is not a legal argument to this wrapper, cause it doesn't respond to "read". {:level=>:error}

LogStash.conf file:

file {
   path => "/test.txt" (this file contains list of gunzip files)
   start_position => "beginning"
   sincedb_path => "/dev/null"``
   codec => "gzip_lines"
}

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.

udc
  • 17
  • 1
  • 8
  • Possible duplicate of [logstash cloudfront codec plugin: Error: Object: #Version: 1.0 is not a legal argument to this wrapper, cause it doesn't respond to "read"](https://stackoverflow.com/questions/31840020/logstash-cloudfront-codec-plugin-error-object-version-1-0-is-not-a-legal-ar) – Green Jun 16 '18 at 13:52
  • I have to read .gz files but in this post "logstash cloudfront codec plugin: Error: Object: #Version: 1.0 is not a legal argument to this wrapper, cause it doesn't respond to "read" here you are reading normal log files right? then how it resolves my error? – udc Jun 18 '18 at 07:46

1 Answers1

0

Path should be an array of string representing path values not a string.

change your file input to below

file {
   path => ["test.gz",test_*.gz] #you can specify all those paths comma separated with wildcard also
   start_position => "beginning"
   sincedb_path => "/dev/null"``
   codec => "gzip_lines"
}