github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/user_agent.en.md (about) 1 ### `user_agent()` {#fn-user-agent} 2 3 Function prototype: `fn user_agent(key: str)` 4 5 Function description: Obtain client information on the specified field 6 7 Function parameters: 8 9 - `key`: the field to be extracted 10 11 `user_agent()` will generate multiple fields, such as: 12 13 - `os`: operating system 14 - `browser`: browser 15 16 Example: 17 18 ```python 19 # data to be processed 20 # { 21 # "userAgent" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36", 22 # "second" : 2, 23 # "third" : "abc", 24 # "forth" : true 25 # } 26 27 json(_, userAgent) user_agent(userAgent) 28 ```