Splunk Search

How to find 10 most active folders by their action of uploading documents

splunkman341
Communicator

Hey guys,

So I am trying to create a search that fetches the top 10 most active OOIDs (Organization ID Folder) by their activity of AOIDS (associate IDS) uploading documents into said folders. The idea is to get the number of AOIDS for each OOID.

For example, you have three companies:

Company A XYZ(OOID) has uploaded 300 documents, but only 20 AOIDS uploaded those documents

Company B ABC(OOID) has uploaded 200 documents, but 100 AOIDS uploaded those documents

The log of where I need to create the search out of is here:

Thanks for looking and please let me know if you have any questions!

0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

index = foo | stats dc(AOID) AS AOIDs by OOID | sort 10 - AOIDs

This judges "activity" not by raw activity but by the highest number of AOIDs that have any activity (which may not be correct); this judges by raw events:

index = foo | stats count dc(AOID) AS AOIDs by OOID | sort 10 - count

View solution in original post

woodcock
Esteemed Legend

Try this:

index = foo | stats dc(AOID) AS AOIDs by OOID | sort 10 - AOIDs

This judges "activity" not by raw activity but by the highest number of AOIDs that have any activity (which may not be correct); this judges by raw events:

index = foo | stats count dc(AOID) AS AOIDs by OOID | sort 10 - count

splunkman341
Communicator

You crushed the nail through the plywood, exactly what I wanted!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this untested search:

index = foo | top AOID by OOID | table OOID AOID
---
If this reply helps you, Karma would be appreciated.
0 Karma

splunkman341
Communicator

It is generating events but no statistics or a table

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I've updated my answer.

---
If this reply helps you, Karma would be appreciated.
0 Karma

splunkman341
Communicator

I just need the number of AOIDS per OOID. The AOID name is not needed in this instace

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You put a regex tag on this question. Does that mean you don't have the OOID and AOID fields extracted?

---
If this reply helps you, Karma would be appreciated.
0 Karma

splunkman341
Communicator

Hi Rich and thanks for you're response,

I just checked and I actually do have them extracted, I just was not sure where to go from here

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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