# Parse only files with given extension into logstash

**URL:** <https://discuss.elastic.co/t/parse-only-files-with-given-extension-into-logstash/155123>\
**Category:** Logstash\
**Created:** [November 2, 2018, 6:53am UTC](https://discuss.elastic.co/t/parse-only-files-with-given-extension-into-logstash/155123 "2018-11-02T06:53:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GitSpree23](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@GitSpree23](https://discuss.elastic.co/u/GitSpree23)\
**Post date:** [November 2, 2018, 6:53am UTC](https://discuss.elastic.co/t/parse-only-files-with-given-extension-into-logstash/155123/1 "2018-11-02T06:53:16Z")

</div>

I am using the following input plugin to parse ".gz" files in all subfolders into logstash:

```
    input {
            file {
                    #type => "gzip"
                    path => "/home/xyz/data/sample/ **/** /*"
                    mode => "read"
                    file_completed_action => "log"
                    file_completed_log_path => "/home/xyz/data/log.txt"
            }
    }

```

The final level subfolder contains ".gz" files but also a metadata file with ".info" extension. I want LS to only push data from ".gz" files and ignore ".info" files.  
How do I do that?  
Using "type" doesn't help.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [November 2, 2018, 12:43pm UTC](https://discuss.elastic.co/t/parse-only-files-with-given-extension-into-logstash/155123/2 "2018-11-02T12:43:44Z")

</div>

The `path` directive takes a glob-pattern. Try specifying a glob that only matches what you are looking for, e.g. `/home/xyz/data/sample/ **/** /*.gz`.

---

<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:** [November 30, 2018, 12:43pm UTC](https://discuss.elastic.co/t/parse-only-files-with-given-extension-into-logstash/155123/3 "2018-11-30T12:43:51Z")

</div>

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