# How to read gzip encoding from log file

**URL:** <https://discuss.elastic.co/t/how-to-read-gzip-encoding-from-log-file/190886>\
**Category:** Logstash\
**Created:** [July 17, 2019, 6:50am UTC](https://discuss.elastic.co/t/how-to-read-gzip-encoding-from-log-file/190886 "2019-07-17T06:50:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumits1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sumits1000/32/50330_2.png) [@sumits1000](https://discuss.elastic.co/u/sumits1000)\
**Post date:** [July 17, 2019, 6:50am UTC](https://discuss.elastic.co/t/how-to-read-gzip-encoding-from-log-file/190886/1 "2019-07-17T06:50:32Z")

</div>

Hi,  
So I am using logstash to push data to elasticsearch. For backup we are writing the same logs into a file databakup.log. For this we are using gzip true as below:  
output{  
file {  
path =\> "/home/ubuntu/logstash-filelogs/logstash-%{+YYYY-MM-dd}.log"  
gzip =\> true  
}  
}  
Now I want to read this file in case of elasticsearch goes down. The problem I am facing is that the file input doesn't recognise the format. Below is my config  
input{  
file {  
path =\> "/home/ubuntu/logstash-filelogs/\*"  
start\_position =\> "beginning"  
codec =\> gzip\_lines  
type =\> "gzip"  
mode =\> "read"  
}  
}

Can you please help me understand what I am missing here?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 17, 2019, 1:32pm UTC](https://discuss.elastic.co/t/how-to-read-gzip-encoding-from-log-file/190886/2 "2019-07-17T13:32:35Z")

</div>

What errors do you get?

---

<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:** [August 14, 2019, 1:33pm UTC](https://discuss.elastic.co/t/how-to-read-gzip-encoding-from-log-file/190886/3 "2019-08-14T13:33:29Z")

</div>

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