# Logstash Uknown error while parsing user agent data --\>how to debug further?

**URL:** <https://discuss.elastic.co/t/logstash-uknown-error-while-parsing-user-agent-data-how-to-debug-further/186096>\
**Category:** Logstash\
**Created:** [June 17, 2019, 2:44pm UTC](https://discuss.elastic.co/t/logstash-uknown-error-while-parsing-user-agent-data-how-to-debug-further/186096 "2019-06-17T14:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![herren\_marc](https://avatars.discourse-cdn.com/v4/letter/h/9e8a1a/32.png) [@herren\_marc](https://discuss.elastic.co/u/herren_marc)\
**Post date:** [June 17, 2019, 2:44pm UTC](https://discuss.elastic.co/t/logstash-uknown-error-while-parsing-user-agent-data-how-to-debug-further/186096/1 "2019-06-17T14:44:55Z")

</div>

I have a agent string from apache like:

`" Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"`

and it seems to fail as I see a lot of  
`[2019-06-17T16:40:49,679][ERROR][logstash.filters.useragent] Uknown error while parsing user agent data {:exception=>#<TypeError: cannot convert instance of class org.jruby.RubyHash to class java.lang.String>, :field=>"agent", :event=>#<LogStash::Event:0x4fa41c9c>}`

Can I somehow debug this further? I've tested the grok filter with [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/) and it works as expected, the only issues is with

```
  useragent {
      source => "agent"
    }
```

---

<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:** [June 17, 2019, 3:06pm UTC](https://discuss.elastic.co/t/logstash-uknown-error-while-parsing-user-agent-data-how-to-debug-further/186096/2 "2019-06-17T15:06:27Z")

</div>

That suggests to me that the [agent] field is a hash rather than a string.

---

<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 15, 2019, 3:06pm UTC](https://discuss.elastic.co/t/logstash-uknown-error-while-parsing-user-agent-data-how-to-debug-further/186096/3 "2019-07-15T15:06:29Z")

</div>

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