# Regex in S3 input plugin

**URL:** <https://discuss.elastic.co/t/regex-in-s3-input-plugin/124486>\
**Category:** Logstash\
**Created:** [March 19, 2018, 6:31am UTC](https://discuss.elastic.co/t/regex-in-s3-input-plugin/124486 "2018-03-19T06:31:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eswar\_Kumar\_Musiboin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eswar_kumar_musiboin/32/28623_2.png) [@Eswar\_Kumar\_Musiboin](https://discuss.elastic.co/u/Eswar_Kumar_Musiboin)\
**Post date:** [March 19, 2018, 6:31am UTC](https://discuss.elastic.co/t/regex-in-s3-input-plugin/124486/1 "2018-03-19T06:31:19Z")

</div>

I neeed to get prefix in S3 input by using Regex.. But there is no support for Regex in the doc..  
please find the solution ........

Folders list like this:

logs/20180304/app1/app1.log  
logs/23180304/app2/app2.log  
logs/20180305/app1/app1.log  
logs/23180305/app2/app2.log  
logs/20180306/app1/app1.log  
logs/23180306/app2/app2.log

my input plugin in Logstash

> ```
> s3
> {
> access_key_id => "ABDCWERJKPOKJVB"
> secret_access_key => "4356ytghnfvgbh09oiujsedfvgh0piod"
> region => "as-sfg-2"
> bucket => "new-logs"
> prefix => "log/*/app1/app1.log
> }
> s3
> {
> access_key_id => "ABDCWERJKPOKJVB"
> secret_access_key => "4356ytghnfvgbh09oiujsedfvgh0piod"
> region => "as-sfg-2"
> bucket => "new-logs"
> prefix => "log/*/app1/app2.log
> }
> 
> ```

I tried the above prefix But logstash not getting the logs from those prefixe

---

<div class="post-metadata">

**Author:** ![Eswar\_Kumar\_Musiboin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eswar_kumar_musiboin/32/28623_2.png) [@Eswar\_Kumar\_Musiboin](https://discuss.elastic.co/u/Eswar_Kumar_Musiboin)\
**Post date:** [March 23, 2018, 9:09am UTC](https://discuss.elastic.co/t/regex-in-s3-input-plugin/124486/2 "2018-03-23T09:09:35Z")

</div>

Can anyone help me on this? Or is there any way to get complete s3 path of a log file in filter?

---

<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 20, 2018, 9:09am UTC](https://discuss.elastic.co/t/regex-in-s3-input-plugin/124486/3 "2018-04-20T09:09:56Z")

</div>

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