Splunk Enterprise

How to get total number of Count?

Kirthika
Path Finder

 

Device_ID Handset_ID
1 Serial Number
1 Started
1 1420
1 1420
1 1420
1 Serial Number
1 Started
1 1420
1 Serial Number
1 Started
1 1420
1 1420
1 1420
1 Serial Number
1 Started
1 Serial Number
1 Started
2 1420
2 1420
2 Serial Number
2 Started
2 Serial Number
2 Started
2 Serial Number
2 Started
2 20
2 Serial Number
2 Started
2 Serial Number
2 Started

 

Expected Output: Count should be based on keyword "Serial Number"  followed by Handset_ID to another "Serial Number". If there is no Handset_ID between , it should skip the rows. Eg.last 4 rows

Handset_ID Total Count
1420 4
20 1
Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| where Handset_ID == "Serial Number" OR match(Handset_ID, "\d+")
| autoregress Handset_ID
| where Handset_ID_p1 == "Serial Number" AND match(Handset_ID, "\d+")
| stats count by Handset_ID

Kirthika
Path Finder

Thanks. Its working

Tags (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Kirthika,

You can try below;

| autoregress Handset_ID
| search Handset_ID_p1="Started" Handset_ID!="Serial Number"
| stats count by Handset_ID
If this reply helps you an upvote and "Accept as Solution" is appreciated.

Kirthika
Path Finder

Hi,

 

Thanks for your reply. Its working

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Get More Out of Your Security Practice With a SIEM

Get More Out of Your Security Practice With a SIEMWednesday, July 31, 2024  |  11AM PT / 2PM ETREGISTER ...