Splunk Search

I need to know which index and app has been access how many time in last one month

csharm21
Loves-to-Learn

I need to know how many time all the indexes in my splunk has been accessed in last 30 days by app name(I tried so many posts but none of the post resolved my issue). can anyone help me to get this fixed.

Tags (1)
0 Karma

p_gurav
Champion

This may help you:

index=_audit action=search search=* sourcetype=audittrail  | rex field=search "sourcetype\s*=\s*\"*(?<SourcetypeUsed>[^\s\"]+)"  | rex field=search "index\s*=\s*\"*(?<IndexUsed>[^\s\"]+)" | search IndexUsed=* OR SourcetypeUsed=* | fillnull value="NA" IndexUsed SourcetypeUsed| stats count by IndexUsed SourcetypeUsed

The count represents a number of searches execution that are using that index/sourcetype.

efavreau
Motivator

Based on the comment thread, @p_gurav, you should convert your comment to an answer, so @csharm21 can accept it.
@csharm21 you should ask that as a separate question, in my humble opinion. Adding the APP to the query, most likely means you're querying _internal also, which would require a lot more work to add in.

###

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

csharm21
Loves-to-Learn

Thanks p_gurav, this is working. I also need to filter this by application name. would you be able to help on this.

0 Karma

broberg
Communicator

What you mean by "accessed", do you mean how many time somone searched in an index?
That information can you see in _audit.

0 Karma

csharm21
Loves-to-Learn

@broberge yes i need to pull detail how many time some one searched the index. if that index has not been searched more then one month, we will do clean up. I tried multiple things using _Audit but still no luck.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us in this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...