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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...