Splunk Search

count filename form a message

Nilesh067
Explorer

message: 'Successfully downloaded the file : FileAData2020-10-20_19_05_05.csv'

message: 'Successfully downloaded the file : FileBData2020-10-20_19_05_05.csv'

message: 'Successfully downloaded the file : FileCData2020-10-20_19_05_05.csv'

message: 'Successfully downloaded the file : FileAData2020-10-20_19_05_05.csv'

 

how can I get output like 

FileName Count

FileA            2

FileB            1

FileC           1

 

Labels (4)
0 Karma

to4kawa
Ultra Champion
index=_internal | head 1 | eval _raw="message: 'Successfully downloaded the file : FileAData2020-10-20_19_05_05.csv'
message: 'Successfully downloaded the file : FileBData2020-10-20_19_05_05.csv'
message: 'Successfully downloaded the file : FileCData2020-10-20_19_05_05.csv'
message: 'Successfully downloaded the file : FileAData2020-10-20_19_05_05.csv'"
| multikv noheader=t
| rename COMMENT as "the logic" 
| rex "file : (?<filename>\w+)Data"
| stats count by filename
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Data Management Digest – August 2026

MichelleCorpora_1-1788182384472.png Welcome to the August 2026 edition of Data Management Digest! August was a ...

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...