# When writing to ES and get 400 status code, can you get the original log message?

**URL:** <https://discuss.elastic.co/t/when-writing-to-es-and-get-400-status-code-can-you-get-the-original-log-message/290239>\
**Category:** Logstash\
**Created:** [November 26, 2021, 6:35am UTC](https://discuss.elastic.co/t/when-writing-to-es-and-get-400-status-code-can-you-get-the-original-log-message/290239 "2021-11-26T06:35:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zcola/32/27971_2.png) [@zcola](https://discuss.elastic.co/u/zcola)\
**Post date:** [November 26, 2021, 6:35am UTC](https://discuss.elastic.co/t/when-writing-to-es-and-get-400-status-code-can-you-get-the-original-log-message/290239/1 "2021-11-26T06:35:23Z")

</div>

```auto
{:status=>400, :action=>["index", {:_id=>nil, :_index=>"monitor3_api_logtail_write", :_type=>"logs", :routing=>nil}, #<LogStash::Event:0x4d7726f5>], 
:response=>{"index"=>{"_index"=>"monitor3_api_logtail-2021.11.25-000685", "_type"=>"logs", "_id"=>"Ko_xWn0B1NtYVV5qtfW-", "status"=>400, 
"error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [data.query] of type [keyword] in document with id 'Ko_xWn0B1NtYVV5qtfW-'", 
"caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Can't get text on a START_OBJECT at 1:206"}}}}}

```

I want to fix this problem from upstream, I need to get the original message content

---

<div class="post-metadata">

**Author:** ![zcola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zcola/32/27971_2.png) [@zcola](https://discuss.elastic.co/u/zcola)\
**Post date:** [November 26, 2021, 10:54am UTC](https://discuss.elastic.co/t/when-writing-to-es-and-get-400-status-code-can-you-get-the-original-log-message/290239/2 "2021-11-26T10:54:49Z")

</div>

logstash 7.15.2 can solve this problem

---

<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:** [December 24, 2021, 10:54am UTC](https://discuss.elastic.co/t/when-writing-to-es-and-get-400-status-code-can-you-get-the-original-log-message/290239/3 "2021-12-24T10:54:53Z")

</div>

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