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
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...