# Create index in elasticsearch for a file in S3 bucket

**URL:** https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073
**Category:** Elasticsearch
**Created:** [December 28, 2015, 7:53pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073 "2015-12-28T19:53:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Bharath\_Varre](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bharath\_Varre](https://discuss.elastic.co/u/Bharath_Varre)
#### Post date: [December 28, 2015, 7:53pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/1 "2015-12-28T19:53:06Z")

</div>

Hello,

Is it possible to create an index just for one file in a S3 bucket?

Also,is it possible to change the type or tag based on the file name in the bucket.

Thank you.  
Sai

---

<div class="post-metadata">

### Author: ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)
#### Post date: [December 28, 2015, 8:00pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/2 "2015-12-28T20:00:15Z")

</div>

Hi,

You could use Logstash's s3 input to create your index:

[https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html)

---

<div class="post-metadata">

### Author: ![Bharath\_Varre](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bharath\_Varre](https://discuss.elastic.co/u/Bharath_Varre)
#### Post date: [December 28, 2015, 8:18pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/3 "2015-12-28T20:18:19Z")

</div>

Hello Mike,

I used the S3 input, but it takes all the files in the bucket. I would like to index just one of the n-files in the buckets.

---

<div class="post-metadata">

### Author: ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)
#### Post date: [December 28, 2015, 8:22pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/4 "2015-12-28T20:22:48Z")

</div>

Hi,

Can you try using a prefix which matches only the file you want and see if that works:

[https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#plugins-inputs-s3-prefix](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html#plugins-inputs-s3-prefix)

---

<div class="post-metadata">

### Author: ![Bharath\_Varre](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bharath\_Varre](https://discuss.elastic.co/u/Bharath_Varre)
#### Post date: [December 28, 2015, 8:41pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/5 "2015-12-28T20:41:13Z")

</div>

That doesn't work either.

Thank you.  
Sai

---

<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: [July 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/create-index-in-elasticsearch-for-a-file-in-s3-bucket/38073/6 "2017-07-05T23:28:14Z")

</div>


