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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...