# \[WARN \]\[logstash.outputs.elasticsearch\] Failed action. {:status=\>400, :action=\>\["index",

**URL:** <https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175>\
**Category:** Logstash\
**Created:** [May 10, 2017, 12:57am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175 "2017-05-10T00:57:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaonbean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaonbean/32/14416_2.png) [@shaonbean](https://discuss.elastic.co/u/shaonbean)\
**Post date:** [May 10, 2017, 12:57am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175/1 "2017-05-10T00:57:22Z")

</div>

# logstash error

[2017-05-10T08:50:56,328][WARN][logstash.outputs.elasticsearch] Failed action. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"filebeat-aniutv-access-2017.05.10", :\_type=\>"aniutv-access", :\_routing=\>nil}, 2017-05-10T00:50:51.000Z localhost.localdomain %{message}], :response=\>{"index"=\>{"\_index"=\>"filebeat-aniutv-access-2017.05.10", "\_type"=\>"aniutv-access", "\_id"=\>"AVvv1mKt\_b-4JY4-UTwo", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse [nginx.access.user\_agent.patch]", "caused\_by"=\>{"type"=\>"number\_format\_exception", "reason"=\>"For input string: "b4""}}}}}

# elk version 5.4 +openjdk1.8

when i config elk+filebeat,the can Normal collection log, But after running for a while, the paper is wrong. Who can help to see the above problem.My elk configuration is based on the website, using the filebeat template to collect nginx's access log

# please help me...

 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/9/995d1c1705580f06bd4c18613c7dbdf3aed82783.png)

---

<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:** [May 10, 2017, 5:45am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175/2 "2017-05-10T05:45:26Z")

</div>

The nginx.access.user\_agent.patch field has been mapped as an integer but for at least some of your events the field actually contains a string. Why is it mapped as an integer? Is it because of the Filebeat template?

---

<div class="post-metadata">

**Author:** ![shaonbean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaonbean/32/14416_2.png) [@shaonbean](https://discuss.elastic.co/u/shaonbean)\
**Post date:** [May 11, 2017, 1:19am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175/3 "2017-05-11T01:19:04Z")

</div>

yes, i change office logstash nginx filter template,remove nginx.access.user\_agent.patch , logstash can works.

---

<div class="post-metadata">

**Author:** ![chaokunyang](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@chaokunyang](https://discuss.elastic.co/u/chaokunyang)\
**Post date:** [May 26, 2017, 7:31am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175/4 "2017-05-26T07:31:43Z")

</div>

In filebeat 5.3, It's mapped to long. [https://www.elastic.co/guide/en/beats/filebeat/master/exported-fields-nginx.html#\_nginx\_access\_user\_agent\_patch](https://www.elastic.co/guide/en/beats/filebeat/master/exported-fields-nginx.html#_nginx_access_user_agent_patch)  
So mapper\_parsing\_exception will happen too, when patch is string.  
Ex:WARN Can not index event (status=400): {"type":"mapper\_parsing\_exception","reason":"failed to parse [nginx.access.user\_agent.patch]","caused\_by":{"type":"number\_format\_exception","reason":"For input string: "b4""}}

---

<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 23, 2017, 7:31am UTC](https://discuss.elastic.co/t/warn-logstash-outputs-elasticsearch-failed-action-status-400-action-index/85175/5 "2017-06-23T07:31:52Z")

</div>

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