# Multiple values in a string value in logstash?

**URL:** <https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316>\
**Category:** Logstash\
**Created:** [December 10, 2020, 5:58pm UTC](https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316 "2020-12-10T17:58:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GetYourSh1tTogether](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GetYourSh1tTogether](https://discuss.elastic.co/u/GetYourSh1tTogether)\
**Post date:** [December 10, 2020, 5:58pm UTC](https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316/1 "2020-12-10T17:58:18Z")

</div>

I am trying to set up this plugin by itself it works great and imports everything in the bucket. However, there are tons of subdirectories that i would like to prevent logstash from reading. I found this field "[exclude\_pattern"](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#plugins-inputs-s3-exclude_pattern) and it works great for just one value. How can I add more values to it without throwing an error?

Currently, I have tried the following and it has thrown an error at me, saying it was expecting "exclude\_pattern" =\> "someValue".  
Attempt 1:

```auto
"exclude_pattern" => "/05/"
"exclude_pattern" => "/10/"

```

Attempt 2:

```auto
"exclude_pattern" => ["/05/", "/10/"]

```

I have even tried using grok to filter for the names of the subdirectories i need and seems to fail with this plugin. Kind of stumped on this, any advice?

---

<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:** [December 10, 2020, 6:22pm UTC](https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316/2 "2020-12-10T18:22:59Z")

</div>

The exclude\_pattern option takes a single string, but you can use alternation in that string

```
exclude_pattern => "/(05|10)/"
```

---

<div class="post-metadata">

**Author:** ![GetYourSh1tTogether](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GetYourSh1tTogether](https://discuss.elastic.co/u/GetYourSh1tTogether)\
**Post date:** [December 10, 2020, 7:46pm UTC](https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316/4 "2020-12-10T19:46:10Z")

</div>

You are a legend that worked like a charm! Been banging my head trying to figure this out for a while.

---

<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:** [January 7, 2021, 7:46pm UTC](https://discuss.elastic.co/t/multiple-values-in-a-string-value-in-logstash/258316/5 "2021-01-07T19:46:11Z")

</div>

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