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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...