# How to create mapping fields using logstash

**URL:** <https://discuss.elastic.co/t/how-to-create-mapping-fields-using-logstash/182989>\
**Category:** Logstash\
**Created:** [May 28, 2019, 5:58am UTC](https://discuss.elastic.co/t/how-to-create-mapping-fields-using-logstash/182989 "2019-05-28T05:58:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunkvinam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arunkvinam/32/43899_2.png) [@arunkvinam](https://discuss.elastic.co/u/arunkvinam)\
**Post date:** [May 28, 2019, 5:58am UTC](https://discuss.elastic.co/t/how-to-create-mapping-fields-using-logstash/182989/1 "2019-05-28T05:58:34Z")

</div>

Iam try to synch mysql data with elasticsearch using logstash . But I can't define field type as "keyword" and asign normalizer in logstash.How I solve this issue.

I have to perform somany wildcard query,that's why iam using keyword as field type

---

<div class="post-metadata">

**Author:** ![arunkvinam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arunkvinam/32/43899_2.png) [@arunkvinam](https://discuss.elastic.co/u/arunkvinam)\
**Post date:** [May 28, 2019, 6:01am UTC](https://discuss.elastic.co/t/how-to-create-mapping-fields-using-logstash/182989/2 "2019-05-28T06:01:08Z")

</div>

input {

jdbc {  
jdbc\_driver\_library =\> "/home/arun/Downloads/mysql-connector-java-5.1.42.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "databaseconnection"  
jdbc\_user =\> "resuemb"  
jdbc\_password =\> "JlZTDCte^0F~F1A"  
#schedule =\> "\*/1 \* \* \* \*"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "20000"  
jdbc\_fetch\_size =\> "50000"  
statement =\> "SELECT pf.id,pf.master\_record\_id,pf.id as recordid,last\_viewed\_date\_time, pf.project\_name as name, pf.app\_id AS appid, pf.owner\_id FROM project\_fields pf WHERE IFNULL(pf.isdeleted\_recycle\_bin,0) = 0 and pf.app\_id = 142 limit 50000 "  
type=\> "project"  
}  
}  
filter {  
mutate {  
convert =\> {  
"name" =\> "keyword"  
}  
}  
}  
output {  
elasticsearch {  
index =\> "%{appid}-%{type}"  
document\_id =\> "%{master\_record\_id}"  
hosts =\> ["127.0.0.1:9200"]  
}  
}

---

<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:** [June 25, 2019, 6:05am UTC](https://discuss.elastic.co/t/how-to-create-mapping-fields-using-logstash/182989/3 "2019-06-25T06:05:00Z")

</div>

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