# Getting illegal\_state\_exception error while pushing logs to elasticsearch

**URL:** <https://discuss.elastic.co/t/getting-illegal-state-exception-error-while-pushing-logs-to-elasticsearch/290029>\
**Category:** Logstash\
**Created:** [November 24, 2021, 9:00am UTC](https://discuss.elastic.co/t/getting-illegal-state-exception-error-while-pushing-logs-to-elasticsearch/290029 "2021-11-24T09:00:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Chitrank\_Tyagi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chitrank_tyagi/32/97507_2.png) [@Chitrank\_Tyagi](https://discuss.elastic.co/u/Chitrank_Tyagi)\
**Post date:** [November 24, 2021, 9:00am UTC](https://discuss.elastic.co/t/getting-illegal-state-exception-error-while-pushing-logs-to-elasticsearch/290029/1 "2021-11-24T09:00:33Z")

</div>

I'm getting illegal\_state\_exception error, Can someone please help me this?  
mapping\_template.json :

> **[mapping\_template.json](https://docs.google.com/document/d/16xi-hrHlHnAXlEwIk8cMX-01KtTcwZmGxUQOOYC3N3o/edit?usp=sharing)**
>
> { "index\_patterns": \["mapi-\*"\], "mappings": { "properties": { "@timestamp": { "type": "date" }, "@version": { "type": "text", "fields": { "keyword": { "type": "keyword", ...

error:  
"error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [message] of type [text] in document with id '4H4sUH0BtmRbYfd3eWxi'. Preview of field's value: '{level=info, host=gcard-service-ep-7c6cbbb5fc-x64xj, message=service: GiftcardNotifierService.attemptRecipientEmail recipient email sent, timestamp=2021-11-24T04:20:24.203523577Z}'", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Can't get text on a START\_OBJECT at 1:41"}}}}}

---

_[View the full topic](https://discuss.elastic.co/t/getting-illegal-state-exception-error-while-pushing-logs-to-elasticsearch/290029)._
