Splunk Search

Append 2 searches together in o365 to show if a file share has been deleted

nathanluke86
Communicator

I have a search query to display external files shares that are active (Sharepoint/Onedrive).

 

 

This is working and shows us when file shares to third parties are still active.

index=o365 file_path=* user=urn* OR TargetUserOrGroupType=Guest
| fillnull value="-"
| dedup UniqueSharingId TargetUserOrGroupName
| where NOT Operation=="RemovedFromSecureLink"
|stats latest(_time) by user Operation file_path file_name vendor_product TargetUserOrGroupName UniqueSharingId

The issue we have is if a user just deletes the file share folder (so no longer an active share) the dashboard still displays the share as active.

 

I need to append the following search and match to the unique sharing location to display if the file/folder has been deleted:

index=o365 Operation=FileDeleted

 

 

 

TIA

Labels (1)
0 Karma

rupkumar4sec
Path Finder

You can use a sub search to ignore the deleted files from results. Something like 

index=o365 file_path=* user=urn* OR TargetUserOrGroupType=Guest NOT
[ search index=o365 Operation=FileDeleted
| table file_path,file_name ]
| fillnull value="-"
| dedup UniqueSharingId TargetUserOrGroupName
| where NOT Operation=="RemovedFromSecureLink"
| stats latest(_time) by user Operation file_path file_name vendor_product TargetUserOrGroupName UniqueSharingId

 

 

0 Karma
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...