# Ingest logs from S3 bucket

**URL:** <https://discuss.elastic.co/t/ingest-logs-from-s3-bucket/328155>\
**Category:** Elasticsearch\
**Created:** [March 21, 2023, 10:25am UTC](https://discuss.elastic.co/t/ingest-logs-from-s3-bucket/328155 "2023-03-21T10:25:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_sirugudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_sirugudi/32/94019_2.png) [@rahul\_sirugudi](https://discuss.elastic.co/u/rahul_sirugudi)\
**Post date:** [March 21, 2023, 10:25am UTC](https://discuss.elastic.co/t/ingest-logs-from-s3-bucket/328155/1 "2023-03-21T10:25:43Z")

</div>

Currently i am using elk stack to ingest only warning and errors logs to Elasticsearch server. Also i am using elastic beanstalk to rotate logs to S3 bucket.

Now as i ingest only warning and error logs sometimes i need even INFO logs for this scenario what i have done is to ingest from s3 using s3-input-plugin, but what ever logs in kibana dashboard are different to the files i have downloaded manually. Also can i use regex while using prefix?

```auto
input {
  s3 {
    bucket => "your-s3-bucket-name"
    access_key_id => "your-aws-access-key-id"
    secret_access_key => "your-aws-secret-access-key"
    region => "your-aws-region"
    prefix => "resources/environments/logs/publish/e-j2efvpwbsx/*/catalina.2023-03-17-1.*.gz"
    codec => "json"
  }
}

output {
  elasticsearch {
    hosts => ["your-elasticsearch-host:9200"]
    index => "your-elasticsearch-index-name"
  }
}

```

---

<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 18, 2023, 10:26am UTC](https://discuss.elastic.co/t/ingest-logs-from-s3-bucket/328155/2 "2023-04-18T10:26:31Z")

</div>

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