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!

test 2

test 222222

test

test

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...