# S3 input "include pattern"?

**URL:** <https://discuss.elastic.co/t/s3-input-include-pattern/79949>\
**Category:** Logstash\
**Created:** [March 24, 2017, 9:20pm UTC](https://discuss.elastic.co/t/s3-input-include-pattern/79949 "2017-03-24T21:20:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allie\_Yang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/allie_yang/32/16538_2.png) [@Allie\_Yang](https://discuss.elastic.co/u/Allie_Yang)\
**Post date:** [March 24, 2017, 9:20pm UTC](https://discuss.elastic.co/t/s3-input-include-pattern/79949/1 "2017-03-24T21:20:47Z")

</div>

I have many files in my s3 bucket, is there a way to specify the pattern I want to include?

They are in several different sub-buckets, so i don't think i can use prefix..

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [March 31, 2017, 1:03pm UTC](https://discuss.elastic.co/t/s3-input-include-pattern/79949/2 "2017-03-31T13:03:30Z")

</div>

Hello,

The S3 inputs doesn't current support any option to only match only on specific pattern, but the plugin has an `exclude _pattern`, Could that work for your case?

It support Ruby style format, the following example will ignore any key in the bucket starting with "hello"

```auto

s3 {
#...
exclude_pattern => "^hello"
}

```

Ref: [https://github.com/logstash-plugins/logstash-input-s3/blob/master/lib/logstash/inputs/s3.rb#L55](https://github.com/logstash-plugins/logstash-input-s3/blob/master/lib/logstash/inputs/s3.rb#L55)

---

<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:** [April 28, 2017, 1:03pm UTC](https://discuss.elastic.co/t/s3-input-include-pattern/79949/3 "2017-04-28T13:03:47Z")

</div>

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