Skip to content

User Agent Parser - Bro implementation based on uap-core

License

Notifications You must be signed in to change notification settings

vitalyrepin/uap-bro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Agent Parser - Bro implementation based on uap-core
uap-bro
==========

User Agent Parser - Bro implementation based on uap-core

Installation
------------

bro-pkg install vitalyrepin/uap-bro

Configuration options
---------------------

uap_core_regex_path  - path to the regexp file from uap-core project (bundled with this package)

API
---

Three record types are defined in  uap-bro/scripts/types.bro  - DeviceRec, AgentRec and UserAgentRec.

In oprder to parse user-agent string, use the function parse which returns record of type UserAgentRec.

Example:

   local ua: UAP::UserAgentRec;
   ua = UAP::parse(c$http$user_agent);

Three utility functions are defined in  uap-bro/scripts/uap-utils.bro:

   function AgentRecToVersionString(agent: AgentRec): string
   function AgentRecToString(agent: AgentRec): string
   function UserAgentRecToString(ua: UserAgentRec): string

Example:

   ua_str = UAP::UserAgentRecToString(ua);

About

User Agent Parser - Bro implementation based on uap-core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published