# Document contains at least one immense term in field="errormsg.keyword" (whose UTF8 encoding is longer than the max length 32766

**URL:** https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171
**Category:** Elasticsearch
**Created:** [June 13, 2017, 11:00am UTC](https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171 "2017-06-13T11:00:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)
#### Post date: [June 13, 2017, 11:00am UTC](https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171/1 "2017-06-13T11:00:06Z")

</div>

Hi there,i get this error when logstash try to write in [elasticsearch.it](http://elasticsearch.it) create the index but there is no data available on elasticsearch.

`Document contains at least one immense term in field="errormsg.keyword" (whose UTF8 encoding is longer than the max length 32766`

this is my pipeline.conf.

```
input {
        file {
        path => "c:/logstash.log"
        start_position => "beginning"
        codec => multiline {
         pattern => "^%{TIMESTAMP_ISO8601}"
         negate => true
         what => "previous"
   }
        }

}
filter {
grok{
	  match => { "message" => "%{TIME:timestamp} %{LOGLEVEL:LEVEL} %{GREEDYDATA:errormsg}" }
	}
}
output {
if	"ERROR" in [LEVEL]
{
elasticsearch {
  hosts=>"localhost:9200"
  }
  }
stdout { codec => rubydebug }
}

```

thanks for help.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 14, 2017, 8:10am UTC](https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171/2 "2017-06-14T08:10:14Z")

</div>

Hey,

you are trying to index the `errormsg` as a keyword field, which does not make much sense, because that is a field only used for full-text search, but not for aggregations or similar. If you are processing long multi line errors, the size of this can exceed 32kb, which results in this error.

You should change the mapping of that field to be only `text` and not have a `keyword` multi field in it.

--Alex

---

<div class="post-metadata">

### Author: ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)
#### Post date: [June 14, 2017, 9:13am UTC](https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171/3 "2017-06-14T09:13:56Z")

</div>

Thank you @spinscale for your answer.yes i am processing long multiline errors in the field errormsg .  
So,where i can change the mapping of that field to be only text?

---

<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 12, 2017, 9:14am UTC](https://discuss.elastic.co/t/document-contains-at-least-one-immense-term-in-field-errormsg-keyword-whose-utf8-encoding-is-longer-than-the-max-length-32766/89171/4 "2017-07-12T09:14:05Z")

</div>

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