# Error import data

**URL:** <https://discuss.elastic.co/t/error-import-data/192925>\
**Category:** Logstash\
**Created:** [July 30, 2019, 2:41pm UTC](https://discuss.elastic.co/t/error-import-data/192925 "2019-07-30T14:41:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_MORVAN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axel_morvan/32/46439_2.png) [@Axel\_MORVAN](https://discuss.elastic.co/u/Axel_MORVAN)\
**Post date:** [July 30, 2019, 2:41pm UTC](https://discuss.elastic.co/t/error-import-data/192925/1 "2019-07-30T14:41:58Z")

</div>

hello,

I need to import data from a mysql databases with logstash to elasticsearch  
but when i import data i have this error :  
`elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"196366", :_index=>"index", :_type=>"reporting", :routing=>nil}, #<LogStash::Event:0xa9f0db3>], :response=>{"index"=>{"_index"=>"index", "_type"=>"reporting", "_id"=>"196366", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [location] of different type, current_type [geo_point], merged_type [ObjectMapper]"}}}}`

i just have a template for define type geo\_point for a field

Someone can help me ?

---

<div class="post-metadata">

**Author:** ![Silen\_logs](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@Silen\_logs](https://discuss.elastic.co/u/Silen_logs)\
**Post date:** [July 30, 2019, 6:21pm UTC](https://discuss.elastic.co/t/error-import-data/192925/2 "2019-07-30T18:21:32Z")

</div>

Hi,

Can you show your logstash config ? Are you using JDBC plugin ?

---

<div class="post-metadata">

**Author:** ![Axel\_MORVAN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axel_morvan/32/46439_2.png) [@Axel\_MORVAN](https://discuss.elastic.co/u/Axel_MORVAN)\
**Post date:** [July 31, 2019, 6:41am UTC](https://discuss.elastic.co/t/error-import-data/192925/3 "2019-07-31T06:41:57Z")

</div>

Hi

yes i use JDBC plugin  
logstash config :  
`input {  
jdbc {  
jdbc\_driver\_library =\> "mysql-connector-java-8.0.17.jar"  
jdbc\_driver\_class =\> "com.mysql.cj.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/db\_trecobat?useUnicode=true&useJDBCCompliantTimezoneShift=tru$  
jdbc\_user =\> "user"  
jdbc\_password =\> "password"  
statement =\> "SELECT sit\_id, sit\_nom,COUNT(cli\_id) AS nb\_clients,cli\_date\_client,cli\_id,  
SUM(if(cli\_marque\_construction in ('mnb','primobois'),1,0)) AS nb\_clients\_bois, cit\_long as longitude,c$  
ROUND((sum(if(cat\_cli\_type='actif',1,0))/SUM(cli\_id)\*100),0) AS pourcent\_prospect\_actif,  
sum(if(ev\_type='R1',1,0)) AS nb\_R1,  
sum(if(ev\_type='R2',1,0)) AS nb\_R2,  
sum(if(ev\_type='R3',1,0)) AS nb\_R3  
FROM clients  
LEFT OUTER JOIN client\_events ON ev\_cli\_id=cli\_id AND ev\_type IN ('R1','R2','R3') AND ev\_actif  
INNER JOIN sites ON cli\_site\_propect=sit\_id  
INNER JOIN categories on cli\_cat\_origine=cat\_id  
INNER JOIN tables\_diverses.cities ON cli\_cp\_chantier=tables\_diverses.cities.cit\_code  
WHERE cli\_marque\_construction  
not in('extenbois','directmob','isytec','Mureno','office\_sante')  
AND cli\_site\_propect in(7,45,5,18,6,3,9,10,16,53,17,11,14,47,15)  
group by cli\_id"  
}  
}  
filter {  
mutate{  
convert =\> ["%{latitude}", "float"]  
convert =\> ["%{longitude}", "float"]  
add\_field =\> {  
"[location][lat]" =\> "%{latitude}"  
"[location][lon]" =\> "%{longitude}"  
}  
}

}  
output {  
stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "index\_trecobat"  
document\_type =\> "reporting"  
document\_id =\> "%{cli\_id}"  
}  
}`  
But with my template the import work fine

---

<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:** [August 28, 2019, 6:42am UTC](https://discuss.elastic.co/t/error-import-data/192925/4 "2019-08-28T06:42:02Z")

</div>

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