Splunk Search

Best way to dump Azure UPNs into scheduled lookup.

fdevera
Path Finder

I'm trying to dump this info into a scheduled lookup but these are just azuread UPNs that are appearing in the logs for whatever search time it's set to. How do I efficiently get ALL UPNs that are in this rex format regardless of log time?

index=azuread
| rex field=initiatedBy.user.userPrincipalName "ex(?<GUID>\d+)z\@"
| search GUID=*
| dedup initiatedBy.user.userPrincipalName
| table initiatedBy.user.userPrincipalName, GUID
| outputlookup zguids.csv

Labels (2)
Tags (1)
0 Karma
1 Solution

tscroggins
Influencer

@fdevera 

A typical recurring lookup generator would append to the existing lookup:

index=azuread
| rex field=initiatedBy.user.userPrincipalName "ex(?<GUID>\d+)z\@"
| search GUID=*
| table initiatedBy.user.userPrincipalName, GUID
| inputlookup append=t zguids.csv
| dedup initiatedBy.user.userPrincipalName
| outputlookup zguids.csv

The initial lookup can be populated by executing the search manually over a sufficient range of time. Subsequent searches should be limited to the schedule window. I.e. For an hourly search, set earliest=-1h@h latest=@h. Be sure to account for input lag and adjust scheduling as needed.

View solution in original post

0 Karma

tscroggins
Influencer

@fdevera 

A typical recurring lookup generator would append to the existing lookup:

index=azuread
| rex field=initiatedBy.user.userPrincipalName "ex(?<GUID>\d+)z\@"
| search GUID=*
| table initiatedBy.user.userPrincipalName, GUID
| inputlookup append=t zguids.csv
| dedup initiatedBy.user.userPrincipalName
| outputlookup zguids.csv

The initial lookup can be populated by executing the search manually over a sufficient range of time. Subsequent searches should be limited to the schedule window. I.e. For an hourly search, set earliest=-1h@h latest=@h. Be sure to account for input lag and adjust scheduling as needed.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...