Parsed User Agent
Query
union SigninLogs,AADNonInteractiveUserSignInLogs
//| where TimeGenerated > ago(30d)
| where isnotempty(UserAgent)
| extend UserAgentDetail = todynamic(parse_user_agent(UserAgent, "browser"))
| extend UserAgentFamily = tostring(parse_json(tostring(UserAgentDetail.Browser)).Family)
| extend UserAgentMajorVersion = toint(parse_json(tostring(UserAgentDetail.Browser)).MajorVersion)
//| summarize count() by UserAgentExplanation
This query is designed to analyze user sign-in logs by examining the user agents involved. Here's a simple breakdown of what it does:
-
Combine Data: It starts by combining data from two sources:
SigninLogsandAADNonInteractiveUserSignInLogs. -
Filter Non-Empty User Agents: It filters the combined data to only include entries where the
UserAgentfield is not empty. This ensures that only records with user agent information are considered. -
Extract User Agent Details:
- It uses the
parse_user_agentfunction to analyze theUserAgentstring and extract detailed information about the browser. - This information is stored in a new column called
UserAgentDetail.
- It uses the
-
Extract Specific User Agent Information:
- It extracts the browser family (e.g., Chrome, Firefox) from the
UserAgentDetailand stores it in a new column calledUserAgentFamily. - It also extracts the major version of the browser and stores it in a column called
UserAgentMajorVersion.
- It extracts the browser family (e.g., Chrome, Firefox) from the
-
Commented Out Parts:
- The line
//| where TimeGenerated > ago(30d)is commented out, which means it is not currently filtering the data to only include entries from the last 30 days. - The line
//| summarize count() by UserAgentis also commented out, which means it is not currently summarizing the data by counting the number of occurrences of each user agent.
- The line
In summary, the query processes sign-in logs to extract and organize information about the browsers used during sign-ins, but it does not currently limit the data to the last 30 days or provide a summary count of user agents.
Details

Jay Kerai
Released: February 26, 2025
Tables
Keywords
Operators