# How to read S3 bucket using filebeat and parse in logstash

**URL:** <https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 27, 2025, 8:03am UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557 "2025-06-27T08:03:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay117](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vijay117](https://discuss.elastic.co/u/vijay117)\
**Post date:** [June 27, 2025, 8:03am UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557/1 "2025-06-27T08:03:59Z")

</div>

Can some one explain how to read the contents of S3 bucket and store in Elasticsearch via logstash

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 27, 2025, 6:51pm UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557/2 "2025-06-27T18:51:20Z")

</div>

Hi @vijay117

Do you want to use filebeat or logstash or both... which one?

A) filebeat-\>logstash-\>elasticsearch  
B) filebeat-\> elasticsearch  
C) logstash-\>elasticsearch

Filebeat s3 input

> **[AWS S3 input | Beats](https://www.elastic.co/docs/reference/beats/filebeat/filebeat-input-aws-s3)**
>
> Use the aws-s3 input to retrieve logs from S3 objects that are pointed to by S3 notification events read from an SQS queue or directly polling list of...

Logstash s3 input

> **[S3 input plugin | Logstash Plugins](https://www.elastic.co/docs/reference/logstash/plugins/plugins-inputs-s3)**
>
> A component of the aws integration plugin, Integration version: v7.1.8, Released on: 2024-07-26, Changelog. For other versions, see the Versioned plugin...

This looks like a duplicate of

> [@How to Access S3 bucket and list the files using logstash?](https://discuss.elastic.co/t/how-to-access-s3-bucket-and-list-the-files-using-logstash/379562):
>
> How to Access S3 bucket and list the files using logstash

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 27, 2025, 7:44pm UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557/3 "2025-06-27T19:44:08Z")

</div>

> [@vijay117](#):
>
> Can some one explain how to read the contents of S3 bucket and store in Elasticsearch via logstash

My suggestion is to use Filebeat or Elastic Agent to get data from S3 and also use SQS queues to receive notification when a new file is created on the S3 bucket.

Logstash s3 input does not work well in medium/large buckets.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 27, 2025, 8:34pm UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557/4 "2025-06-27T20:34:36Z")

</div>

Here is an article on that

> **[Get the most from Elastic Agent with Amazon S3 and SQS](https://www.elastic.co/blog/elastic-agent-amazon-s3-sqs)**
>
> In this post, we cover how the Performance Presets introduced in 8.12 enable new Elastic users to worry less about how the data gets into Elasticsearch and focus on the valuable insights available thr...

---

<div class="post-metadata">

**Author:** ![vijay117](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vijay117](https://discuss.elastic.co/u/vijay117)\
**Post date:** [July 7, 2025, 9:44am UTC](https://discuss.elastic.co/t/how-to-read-s3-bucket-using-filebeat-and-parse-in-logstash/379557/5 "2025-07-07T09:44:54Z")

</div>

Thanks stephen, i only wanted to list the files in a folder in bucket, some how the s3 plugin doesnot work that way, had to create a customised script to access bucket and list the files
