# Creating same index using java ESrepository and logstash

**URL:** <https://discuss.elastic.co/t/creating-same-index-using-java-esrepository-and-logstash/146946>\
**Category:** Logstash\
**Created:** [September 1, 2018, 4:59pm UTC](https://discuss.elastic.co/t/creating-same-index-using-java-esrepository-and-logstash/146946 "2018-09-01T16:59:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LQss](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@LQss](https://discuss.elastic.co/u/LQss)\
**Post date:** [September 1, 2018, 4:59pm UTC](https://discuss.elastic.co/t/creating-same-index-using-java-esrepository-and-logstash/146946/1 "2018-09-01T16:59:04Z")

</div>

My application works when i try to post something using my URIs, ES automatically create a new index.  
And now when i try to put some more data over that index with same name i get an indexing issue.. even tho I am posting same fields with same datatypes.

Here is my logstash configuration:

input {  
file {  
path =\> "C:\Users\USERS\ELK\SpringBootElasticSearchAPP\DATABASE\CSV\DOCTOR\doctor.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","  
columns =\> ["id", "age", "name", "profession"]  
}  
mutate {convert =\> ["id","integer"]}  
mutate {convert =\> ["age","integer"]}  
ruby { code =\> "event.remove('@version')" }  
ruby { code =\> "event.remove('message')" }  
ruby { code =\> "event.remove('path')" }  
ruby { code =\> "event.remove('@timestamp')" }  
ruby { code =\> "event.remove('host')" }  
}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "doctor"  
}  
stdout { codec =\> rubydebug }

```
}

```

Well i changed my logstash index name to doctest like so ( index =\> "doctor") and it worked fine creating a new index just to see the difference it could be something with mapping order or fields names?

Index created using Api request (index: doctor)

{  
"mapping": {  
"doctor": {  
"properties": {....}  
}  
}  
}

Index created using Logstash (index: doctest)

{  
"mapping": {  
"doc": {  
"properties": {....}  
}  
}  
}

Proprieties are the same with same order..

I just want to fix this so i could put multiple documents from my csv file into my elasticsearch using LS and keep posting with my Api requests.

i really need help am so lost ...

---

<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:** [September 29, 2018, 4:59pm UTC](https://discuss.elastic.co/t/creating-same-index-using-java-esrepository-and-logstash/146946/2 "2018-09-29T16:59:04Z")

</div>

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