Forum Discussion
mm83RI
May 22, 2023Tin Contributor
KQL query in sentinel for users first activity
Hi all, since I am new to writing queries I would really appreciate your help. I need to write a query that will show a specific users first activity and last activity in a day. I need to also proj...
Clive_Watson
May 22, 2023Bronze Contributor
mm83RI This should get you started
// Find the firstSeen for a User
SigninLogs
| summarize arg_min(TimeGenerated,*) by UserPrincipalName
// join to last seen data for that user
|join
(
SigninLogs
| summarize arg_max(TimeGenerated,*) by UserPrincipalName
// any column that ends in a "1" is a last seen
) on UserPrincipalName
// Note, the "*" in arg_min and arg_max will return all columns,
// to reduce the noise you can name them or just project the needed ones. e.g.?
| project UserPrincipalName, TimeGenerated, TimeGenerated1, OperationNamemm83RI
May 23, 2023Tin Contributor
This is great. But I would like to project which Activity was his first (for example Teams, Sharepoint site, etc) and the time.
Can I connect join somehow Office Activity with SigninLogs?
Can I connect join somehow Office Activity with SigninLogs?