vectordotdev / vector

A high-performance observability data pipeline.
https://vector.dev
Mozilla Public License 2.0
18.29k stars 1.61k forks source link

Integration 51Degrees device-detection transformer #13118

Open anufrien opened 2 years ago

anufrien commented 2 years ago

A note for the community

Use Cases

No response

Attempted Solutions

No response

Proposal

Integration 51Degrees Device-Detection transformer. This is a good device detection DB. Use user-agent string. Official Site: https://51degrees.com/device-detection Rust Package: https://crates.io/crates/fiftyonedegrees

Default vrl function "parse_user_agent" is good, but commersial db is better

Sample config by the new transformer

[transforms.test]
type='fiftyonedegrees-device-detection'
inputs = ['log']
database = "/path/to/file/db.hash"
source = "User-Agent"
target = "ua"
fields = ["IsMobile"]

Example:

before transform

file.json
{
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
}

after transform
{
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36",
    "ua":
    {
        "IsMobile": false
    }
}

References

No response

Version

No response

dsmith3197 commented 1 year ago

After discussing with the team, we think this should be implemented as an enrichment table.