# Error parsing file from filebeat

**URL:** <https://discuss.elastic.co/t/error-parsing-file-from-filebeat/181015>\
**Category:** Logstash\
**Created:** [May 14, 2019, 2:09pm UTC](https://discuss.elastic.co/t/error-parsing-file-from-filebeat/181015 "2019-05-14T14:09:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hHelen](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@hHelen](https://discuss.elastic.co/u/hHelen)\
**Post date:** [May 14, 2019, 2:09pm UTC](https://discuss.elastic.co/t/error-parsing-file-from-filebeat/181015/1 "2019-05-14T14:09:31Z")

</div>

I have 2 web servers already running filebeats - everything works as expected, I can see the indices. I now added another web server, making it three. The issue is that I configured the filebeat excatly as the previous servers, but for some reason I keep seeing this error.

[2019-05-14T12:11:42,085][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"logstash-2019.05.14", :\_type=\>"doc", :routing=\>nil}, #LogStash::Event:0x4f0fc4a7], :response=\>{"index"=\>{"\_index"=\>"logstash-2019.05.14", "\_type"=\>"doc", "\_id"=\>"R\_1BtmoB45ihaa1VbEeD", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [agent] of type [text]", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Can't get text on a START\_OBJECT at 1:177"}}}}}

Could someone tell me what I may be doing wrong?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 14, 2019, 2:26pm UTC](https://discuss.elastic.co/t/error-parsing-file-from-filebeat/181015/2 "2019-05-14T14:26:20Z")

</div>

Are you using a useragent filter to parse a string field called agent and overwrite it with the parsed agent object? If so, that's not working correctly for your third web server. In elasticsearch a field cannot be sometimes a string and sometimes an object.

There should be a more informative message in the elasticsearch log.

You could try changing the name of the string field that contains the user-agent information so that there is no conflict.

---

<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 11, 2019, 2:26pm UTC](https://discuss.elastic.co/t/error-parsing-file-from-filebeat/181015/3 "2019-06-11T14:26:26Z")

</div>

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