# Unable to execute custom mapping in Elasticsearch 7.10.2 Using Logstash 7.10.2

**URL:** https://discuss.elastic.co/t/unable-to-execute-custom-mapping-in-elasticsearch-7-10-2-using-logstash-7-10-2/302068
**Category:** Logstash
**Created:** [April 11, 2022, 5:55am UTC](https://discuss.elastic.co/t/unable-to-execute-custom-mapping-in-elasticsearch-7-10-2-using-logstash-7-10-2/302068 "2022-04-11T05:55:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Satya\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/satya_n/32/97517_2.png) [@Satya\_N](https://discuss.elastic.co/u/Satya_N)
#### Post date: [April 11, 2022, 5:55am UTC](https://discuss.elastic.co/t/unable-to-execute-custom-mapping-in-elasticsearch-7-10-2-using-logstash-7-10-2/302068/1 "2022-04-11T05:55:15Z")

</div>

Hi All,

I am trying to sync data from mysql to Elasticsearch using logstash 7.10.2..Elasticsearch version I am using is : 7.10.2. When I am executing template using logstash , it is not creating in Elasticsearch so eventually it is inserting it's own mapping based on the values. it is not honoring my template. Please find my logstash config file below.

```auto
input {
  jdbc {
    jdbc_driver_library => "<path>\mysql-connector-java-8.0.13.jar"
    jdbc_driver_class => "com.mysql.jdbc.Driver"
    jdbc_connection_string => "jdbc:mysql://xxx.amazonaws.com:3306/test?sslMode=DISABLED"
    jdbc_user => "<user>"
    jdbc_password => "<pwd>"
    jdbc_paging_enabled => true
    statement => "SELECT fileDataFlag FROM test_data"
  }
}
filter {
  mutate {
    remove_field => ["id", "@version","@timestamp"]
  }
}
output {
  elasticsearch {
	hosts => "<ES Host>"
	index => "test_data_index"
	manage_template => true
	template => "<path>\test2.json"
	template_name => "test_template"
    template_overwrite => true
	ilm_enabled => false
  }
}

```

my template:

{  
"index\_patterns": [  
"test\_data\_\*"  
],  
"template": {  
"settings": {  
"number\_of\_shards": 5  
},  
"mappings": {  
"\_doc":{  
"properties": {  
"fileDataFlag": {  
"type": "keyword"  
}  
}  
}  
}  
}  
}

My issue is what ever I am fetching from database the same values it should push to ES. To achieve this I am taking help of logstash template.. when I push data it is inserting his own mapping and creating the index . please help me.

---

<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: [May 9, 2022, 5:55am UTC](https://discuss.elastic.co/t/unable-to-execute-custom-mapping-in-elasticsearch-7-10-2-using-logstash-7-10-2/302068/2 "2022-05-09T05:55:38Z")

</div>

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