# Default mapping Location

**URL:** <https://discuss.elastic.co/t/default-mapping-location/32950>\
**Category:** Logstash\
**Created:** [October 26, 2015, 5:18am UTC](https://discuss.elastic.co/t/default-mapping-location/32950 "2015-10-26T05:18:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyphen1370](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hyphen1370](https://discuss.elastic.co/u/hyphen1370)\
**Post date:** [October 26, 2015, 5:18am UTC](https://discuss.elastic.co/t/default-mapping-location/32950/1 "2015-10-26T05:18:17Z")

</div>

Hello,

Is there anyone has experience importing MySQL database through Logstash to ElasticSearch? I have issue with the default mapping that LogStash provides. It always convert date to string and Integer to Long. For example, I have table that contains employee data with employee\_id, createDate, and other attributes. When I import, it auto convert the employee\_id to long and createDate to string. Is there anyway to use other mapping for importing or change the default mapping to fit the need. Also, where is the file for default mapping?

Thank you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 26, 2015, 5:50am UTC](https://discuss.elastic.co/t/default-mapping-location/32950/2 "2015-10-26T05:50:13Z")

</div>

You should really define your own mapping before indexing this sort of data.  
The default template is primarily for logging due to the history of the app.

---

<div class="post-metadata">

**Author:** ![hyphen1370](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hyphen1370](https://discuss.elastic.co/u/hyphen1370)\
**Post date:** [October 26, 2015, 6:23am UTC](https://discuss.elastic.co/t/default-mapping-location/32950/3 "2015-10-26T06:23:15Z")

</div>

Thank you for your response. I tried this also. I manually created the mapping as  
{  
"settings": {  
"index": {  
"analysis": {  
"char\_filter": {  
"dot\_pattern": {  
"type": "pattern\_replace",  
"pattern": "\.",  
"replacement": " "  
}  
},  
"analyzer": {  
"dot\_analyzer": {  
"tokenizer": "standard",  
"char\_filter": [  
"dot\_pattern"  
]  
}  
}  
}  
}  
},  
"mappings": {  
"employees": {  
"properties": {  
"index\_id": {  
"type": "string",  
"\_index": {  
"enabled": false  
},  
"store": true  
},  
"report\_id": {  
"type": "integer",  
"index": "not\_analyzed",  
"store": true  
},  
"title": {  
"type": "string",  
"index": "analyzed",  
"store": true  
},  
"Comment": {  
"type": "string",  
"index": "analyzed",  
"store": true  
},  
"Author": {  
"type": "string",  
"index": "analyzed",  
"store": true,  
"analyzer": "dot\_analyzer"  
},  
"sqlDate": {  
"type": "date",  
"index": "not\_analyzed",  
"store": true  
},  
"category": {  
"type": "string",  
"index": "analyzed",  
"store": true  
},  
"report\_type": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"report\_subtype": {  
"type": "string",  
"index": "not\_analyzed",  
"store": true  
},  
"Active": {  
"type": "boolean",  
"index": "not\_analyzed",  
"store": true  
},  
"InactiveBy": {  
"type": "string",  
"index": "analyzed",  
"store": true,  
"analyzer": "dot\_analyzer"  
},  
"InactiveDate": {  
"type": "date",  
"index": "not\_analyzed",  
"store": true  
}  
}  
}  
}  
}

However, Logstash failed to import with 400 error. Do you have example about make this work (or steps you took)?

Thank you

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 26, 2015, 6:43am UTC](https://discuss.elastic.co/t/default-mapping-location/32950/4 "2015-10-26T06:43:33Z")

</div>

> However, Logstash failed to import with 400 error.

More details, please. If there's nothing more in the Logstash log please consult the Elasticsearch log.

---

<div class="post-metadata">

**Author:** ![hyphen1370](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hyphen1370](https://discuss.elastic.co/u/hyphen1370)\
**Post date:** [October 26, 2015, 5:11pm UTC](https://discuss.elastic.co/t/default-mapping-location/32950/5 "2015-10-26T17:11:26Z")

</div>

I am sorry, I have check both logstash and elasticsearch log. They didn't show anything useful. Do you have any suggestion about where to look for more informaton?

---

<div class="post-metadata">

**Author:** ![hyphen1370](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hyphen1370](https://discuss.elastic.co/u/hyphen1370)\
**Post date:** [October 26, 2015, 5:32pm UTC](https://discuss.elastic.co/t/default-mapping-location/32950/6 "2015-10-26T17:32:46Z")

</div>

From the failed action with response of 400, there is this line:

```
<LogStash::Event:0x3ff4b34d @metadata_accessors=#<LogStash::Util::Accessors:0x23053ab4 @store={"retry_count"=>0}, @lut={}>, @cancelled=false,

```

Is that mean anything?

---

<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 6, 2017, 5:25am UTC](https://discuss.elastic.co/t/default-mapping-location/32950/7 "2017-07-06T05:25:22Z")

</div>


