# How to parse .gz (compressed file) using logstash

**URL:** <https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950>\
**Category:** Logstash\
**Created:** [October 31, 2017, 8:20pm UTC](https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950 "2017-10-31T20:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jotsnadasari](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jotsnadasari](https://discuss.elastic.co/u/jotsnadasari)\
**Post date:** [October 31, 2017, 8:20pm UTC](https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950/1 "2017-10-31T20:20:17Z")

</div>

Hi All,

Does latest logstash support parsing .gz files using logstash?

We have a requirement to get .gz files dynamically every hour. We do not know the file names and content. All we know is the file is compressed in .gz format.

We are using logstash version 5.6.0 and using gzip\_lines codec plugin but logstash is not able to parse .gz files. Also using grok filter for parsing/extracting fields.

Sample code

input {  
file {  
type =\> "test-xyz"  
path =\> "/tmp/\*.gz"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
codec =\> "gzip\_lines"  
}  
}

I have seen some old threads saying logstash does not support .gz files.  
Wanted to check whether there is any work around for dynamic .gz files we receive.

Please provide your inputs on this.

Thanks and Regards,

---

<div class="post-metadata">

**Author:** ![nikhilsangvikar](https://avatars.discourse-cdn.com/v4/letter/n/bc8723/32.png) [@nikhilsangvikar](https://discuss.elastic.co/u/nikhilsangvikar)\
**Post date:** [November 3, 2017, 8:50am UTC](https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950/2 "2017-11-03T08:50:51Z")

</div>

No you can't. You will have to do that manually.

Here: [magnusbaeck's reply on Can Logstash process archived data in the .tar.gz format?](https://discuss.elastic.co/t/can-logstash-process-archived-data-in-the-tar-gz-format/91029/2)

---

<div class="post-metadata">

**Author:** ![jotsnadasari](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jotsnadasari](https://discuss.elastic.co/u/jotsnadasari)\
**Post date:** [November 3, 2017, 2:35pm UTC](https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950/3 "2017-11-03T14:35:56Z")

</div>

Thanks Nikhil for the info.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 1, 2017, 2:36pm UTC](https://discuss.elastic.co/t/how-to-parse-gz-compressed-file-using-logstash/105950/4 "2017-12-01T14:36:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
