# How to categorize devices in 4 types like mobile, desktop, tablet, tv using logstash's ua plugin and How to give path to the custom regexes.yaml file in ua plugin of logstash

**URL:** <https://discuss.elastic.co/t/how-to-categorize-devices-in-4-types-like-mobile-desktop-tablet-tv-using-logstashs-ua-plugin-and-how-to-give-path-to-the-custom-regexes-yaml-file-in-ua-plugin-of-logstash/231270>\
**Category:** Logstash\
**Created:** [May 6, 2020, 6:06am UTC](https://discuss.elastic.co/t/how-to-categorize-devices-in-4-types-like-mobile-desktop-tablet-tv-using-logstashs-ua-plugin-and-how-to-give-path-to-the-custom-regexes-yaml-file-in-ua-plugin-of-logstash/231270 "2020-05-06T06:06:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkwarrior](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@darkwarrior](https://discuss.elastic.co/u/darkwarrior)\
**Post date:** [May 6, 2020, 6:06am UTC](https://discuss.elastic.co/t/how-to-categorize-devices-in-4-types-like-mobile-desktop-tablet-tv-using-logstashs-ua-plugin-and-how-to-give-path-to-the-custom-regexes-yaml-file-in-ua-plugin-of-logstash/231270/1 "2020-05-06T06:06:23Z")

</div>

Hey all,

1. I am using user-agent plugin of logstash and its working fine but in device field I am getting specific devices something like nokia , samsung-Gt, iphone, ..... etc for mobiles but here I want device value to be generic like mobiles/smartphones, desktops, tablets, tv etc.
2. I checked the documentation page of ua filter plugin =\> [here](https://www.elastic.co/guide/en/logstash/current/plugins-filters-useragent.html) but the only option I see here is using custom regexes.yaml file to achieve what I want.
3. So I tried to give path to custom regexes.yaml file in ua filter plugin but its giving me an error,

> ```
> useragent {
> source => "agent"
> regexes => "/Users/a/logstash-6.5.4/sample_input_files/regexes.yaml"
> }
> 
> ```

1. and error for above snippet is =\>

> [2020-05-06T11:00:33,628][ERROR][logstash.pipeline] Error registering plugin {:pipeline\_id=\>"main", :plugin=\>"#\<LogStash::FilterDelegator:0x6152b0a4 @metric\_events\_out=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: out value:0, @metric\_events\_in=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: in value:0, @metric\_events\_time=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: duration\_in\_millis value:0, @id="60b5a72bcc8e9a73b43c3e0ebede4ed0ecdba4d7774cef7d68b2a17ef4e66dc3", @klass=LogStash::Filters::UserAgent, @metric\_events=#LogStash::Instrument::NamespacedMetric:0x5086b470, @filter=\<LogStash::Filters::UserAgent regexes=\>"/Users/a/logstash-6.5.4/sample\_input\_files/regexes.yaml", source=\>"agent", id=\>"60b5a72bcc8e9a73b43c3e0ebede4ed0ecdba4d7774cef7d68b2a17ef4e66dc3", enable\_metric=\>true, periodic\_flush=\>false, lru\_cache\_size=\>100000\>\>", **:error=\>"user\_agent\_parsers is missing from yaml"** , :thread=\>"#\<Thread:0x30bb91d8 run\>"}

1. and my regexes.yaml file is same as regexes.yaml file from the link given in the above mentioned documentation. =\> [regexes](https://www.elastic.co/guide/en/logstash/current/plugins-filters-useragent.html#plugins-filters-useragent-regexes)

2. So I do have two questions =\>

Thanks in advance !

---

<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 3, 2020, 6:06am UTC](https://discuss.elastic.co/t/how-to-categorize-devices-in-4-types-like-mobile-desktop-tablet-tv-using-logstashs-ua-plugin-and-how-to-give-path-to-the-custom-regexes-yaml-file-in-ua-plugin-of-logstash/231270/2 "2020-06-03T06:06:31Z")

</div>

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