# User Agent Filter Not Working

**URL:** <https://discuss.elastic.co/t/user-agent-filter-not-working/198795>\
**Category:** Logstash\
**Created:** [September 9, 2019, 9:51pm UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795 "2019-09-09T21:51:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [September 9, 2019, 9:51pm UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/1 "2019-09-09T21:51:34Z")

</div>

I'm not sure what happend but in my migration from 7.0 to 7.2, the user agent filter has stopped identifying properly. For example, given the following user agent `mozilla/5.0 (windows nt 10.0; win64; x64; rv:69.0) gecko/20100101 firefox/69.0` and the following pipeline config:

```auto
    useragent {
      source => "clientrequestuseragent"
      target => "[client][user_agent]"
    }

```

I get the following values:

![image](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e8cdc9a44c5e261bcd507ec1d94f12d477c7a960.png)

I've even tried grabbing the raw regexes.yaml file and specifying it in my useragent config but it makes no difference.

Any ideas?

---

<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:** [September 9, 2019, 11:33pm UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/2 "2019-09-09T23:33:27Z")

</div>

> [@wwalker](#):
>
> Any ideas?

Case sensitivity.

```
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/69.0"

```

gets parsed as

```
    "user_agent" => {
          "build" => "",
             "os" => "Windows",
         "device" => "Other",
           "name" => "Firefox",
          "minor" => "0",
          "major" => "69",
        "os_name" => "Windows"
    }

```

Folding it to lowercase results in everything being Other.

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [September 10, 2019, 12:19am UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/3 "2019-09-10T00:19:36Z")

</div>

Well crap. If I lowercase the regexes file, will that resolve the issue or is there something else in the plugin that prevents that from working?

---

<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:** [September 10, 2019, 11:49am UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/4 "2019-09-10T11:49:15Z")

</div>

If the regexps only use \d, \s, -, . then it could work. Obviously if any of them \W or another uppercase pattern then folding the regexp would change its meaning.

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [September 10, 2019, 2:44pm UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/5 "2019-09-10T14:44:46Z")

</div>

Aww crap....I totally forgot about all that...I opened the file in Notepad++, selected everything, and hit lowercase. It's working now...but there may be some that are not working right.

---

<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:** [October 8, 2019, 2:44pm UTC](https://discuss.elastic.co/t/user-agent-filter-not-working/198795/6 "2019-10-08T14:44:54Z")

</div>

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