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

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 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

  2. So I do have two questions =>

    1. can I categorize devices in 4 types like mobile, desktop, tablet and tv? using some existing functionality of logstash?
    2. or what is the correct way of using custom regexes.yaml file in user-agent plugin of logstash?

Thanks in advance !

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