# Parsing DB data processes the fields as analyzed. Is there a way to change it?

**URL:** https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633
**Category:** Logstash
**Created:** [February 24, 2016, 6:43pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633 "2016-02-24T18:43:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![RaviSidhu](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RaviSidhu](https://discuss.elastic.co/u/RaviSidhu)
#### Post date: [February 24, 2016, 6:43pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/1 "2016-02-24T18:43:25Z")

</div>

Hi,

I am connecting to a database in Logstash, querying a table, and inserting the data in ES. But the fields are all analyzed. Is there a way out for me to allow the strings as not\_analyzed? Although I see the full values in Discover mode in Kibana, I do not see the entire field values in legends or tooltips either.

Best regards,

---

<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: [February 24, 2016, 6:51pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/2 "2016-02-24T18:51:21Z")

</div>

Update the index template that you're using. See options for this in the elasticsearch output plugin documentation.

---

<div class="post-metadata">

### Author: ![RaviSidhu](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RaviSidhu](https://discuss.elastic.co/u/RaviSidhu)
#### Post date: [February 24, 2016, 6:56pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/3 "2016-02-24T18:56:40Z")

</div>

Hi,

Thank you! This is what I have in the template -

{  
"template": "logdb\_test",  
"settings": {  
"analysis": {  
"analyzer": {  
"analyzer\_path\_tokens": {  
"type": "custom",  
"tokenizer": "path\_hierarchy"  
}  
}  
}  
},  
"mappings": {  
"logdb\_test": {  
"dynamic\_templates": [  
{ "my\_dtemplate": {  
"match\_mapping\_type": "string",  
"mapping": {  
"type": "string",  
"analyzer": "not\_analyzed",  
"index": "not\_analyzed",  
"doc\_values": true  
}  
}  
}  
]  
}  
}  
}

Am I missing something?

---

<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: [February 24, 2016, 7:16pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/4 "2016-02-24T19:16:07Z")

</div>

And what is the actual mapping of the index? Did you update the template prior to the creation of the index?

---

<div class="post-metadata">

### Author: ![RaviSidhu](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RaviSidhu](https://discuss.elastic.co/u/RaviSidhu)
#### Post date: [February 24, 2016, 7:22pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/5 "2016-02-24T19:22:00Z")

</div>

Yes, I set up the template before I create the index. It does pick up the template name, but the fields coming from the database show up under a different mapping under Database, like  
"Database": {  
"properties": {  
"pathlevel2": {  
"type": "string"  
},  
"pathlevel1": {  
"type": "string"  
},  
"pathlevel4": {  
"type": "string"  
},

I am not sure why that could be happening.

---

<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: [February 24, 2016, 8:01pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/6 "2016-02-24T20:01:30Z")

</div>

Looks like your template applies to documents of type logdb\_test but the actual documents have the type Database.

---

<div class="post-metadata">

### Author: ![RaviSidhu](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RaviSidhu](https://discuss.elastic.co/u/RaviSidhu)
#### Post date: [February 24, 2016, 8:09pm UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/7 "2016-02-24T20:09:32Z")

</div>

Thank you! Yes, I missed out on that. I made a change to the config file and trying it again.

Best regards,

---

<div class="post-metadata">

### Author: ![RaviSidhu](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@RaviSidhu](https://discuss.elastic.co/u/RaviSidhu)
#### Post date: [February 25, 2016, 4:51am UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/8 "2016-02-25T04:51:28Z")

</div>

Hi Magnus,

Yes, it was the "type" specified in my jdbc filter. It is all sorted now. I am sorry for the hassle.

Thank you for your patience and support.

Best regards,

---

<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:09am UTC](https://discuss.elastic.co/t/parsing-db-data-processes-the-fields-as-analyzed-is-there-a-way-to-change-it/42633/9 "2017-07-06T05:09:50Z")

</div>


