Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ua-parser is not providing the device brand and model details #63

Open
ChimbuChinnadurai opened this issue Aug 12, 2019 · 2 comments
Open

Comments

@ChimbuChinnadurai
Copy link

logstash ua-parser is not providing the device brand and model details. Below is the useragent string which i parsed in the python parser and can see its provided the device branch & model details which is very helpful for our reports.

"clientUserAgent": "MobileApp/1.3.19-Release (iPhone9,3; CPU iPhone OS 12_4 like Mac OS X)"

python ua-parser output:

"clientUserAgent": {
  "user_agent": {
    "major": null,
    "patch": null,
    "minor": null,
    "family": "Mobile Safari UI/WKWebView"
  },
  "device": {
    "brand": "Apple",
    "model": "iPhone9,3",
    "family": "iPhone"
  },
  "os": {
    "major": "12",
    "patch_minor": null,
    "patch": null,
    "minor": "4",
    "family": "iOS"
  },
  "string": "MobileApp/1.3.19-Release (iPhone9,3; CPU iPhone OS 12_4 like Mac OS X)"
}

But logstash ua-parser is missing the device branch and model details. Used the mutate filter and renamed the output.

logstash ua-parser output:

"clientUserAgent.device.family": "iPhone",
"clientUserAgent.os.family": "iOS",
"clientUserAgent.os.patch": "1",
"clientUserAgent.os.major": "12",
"clientUserAgent.os.minor": "4",
"clientUserAgent.user_agent.family": "Mobile Safari UI/WKWebView",
"clientUserAgent.string": "MobileApp/1.3.19-Release (iPhone9,3; CPU iPhone OS 12_4 like Mac OS X)"
@npipet
Copy link

npipet commented Jan 13, 2020

Parser used in the filter has all the details of device (family, model and brand), but only family is keep and forced in the device entry... :(

I think it is not really hard to add these data in the file lib/logstash/filters/useragent.rb, around line 138.

@fabiogermann
Copy link

fabiogermann commented Dec 17, 2021

@npipet @ChimbuChinnadurai I have prepared a version over here: https://github.com/fabiogermann/logstash-filter-useragent
But currently I have issues running the jruby tests
See: #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants