# How to unzip s3 log files in Logstash

**URL:** <https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679>\
**Category:** Logstash\
**Created:** [May 29, 2018, 12:29pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679 "2018-05-29T12:29:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![clash\_of\_clanss](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@clash\_of\_clanss](https://discuss.elastic.co/u/clash_of_clanss)\
**Post date:** [May 29, 2018, 12:29pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/1 "2018-05-29T12:29:07Z")

</div>

Hi,

I have to load s3 log files into an ES. So I read log files from S3 through LogStash. But the problem is, the log files are in zip file format. How to unzip these log files in LogStash?

Thanks,

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [May 29, 2018, 12:47pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/2 "2018-05-29T12:47:07Z")

</div>

The S3 input handles gzipped files. Filenames ending in `.gz` are unzipped and read.  
See [docs](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#_description_33)

---

<div class="post-metadata">

**Author:** ![clash\_of\_clanss](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@clash\_of\_clanss](https://discuss.elastic.co/u/clash_of_clanss)\
**Post date:** [May 29, 2018, 1:01pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/3 "2018-05-29T13:01:59Z")

</div>

Thanks man. so we dont need to do anything to extract these files right?

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [May 29, 2018, 1:14pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/4 "2018-05-29T13:14:51Z")

</div>

It is automatic as long as the filename ends with `.gz`

---

<div class="post-metadata">

**Author:** ![clash\_of\_clanss](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@clash\_of\_clanss](https://discuss.elastic.co/u/clash_of_clanss)\
**Post date:** [May 29, 2018, 1:16pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/5 "2018-05-29T13:16:52Z")

</div>

Thanks guyboertje.

---

<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:** [June 26, 2018, 1:16pm UTC](https://discuss.elastic.co/t/how-to-unzip-s3-log-files-in-logstash/133679/6 "2018-06-26T13:16:53Z")

</div>

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