Splunk Enterprise

Calculate difference

AB24
Loves-to-Learn Everything
 
Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| where Device_Info == "Device Number" OR match(Device_Info,"\d+")
| streamstats count(eval(Device_Info=="Device Number")) as Inspection_Count
| stats values(eval(if(match(Device_Info, "\d+"),Device_Info,null()))) as Device_Info range(_time) as total_duration by Inspection_Count
| where total_duration > 0
| streamstats reset_on_change=t count as Inspection_Count by Device_Info
| eventstats sum(total_duration) as sum_duration by Device_Info
| eval total_duration = total_duration / 60
| eval sum_duration = sum_duration / 60
0 Karma

AB24
Loves-to-Learn Everything

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Remove the reset_on_change=t

0 Karma

AB24
Loves-to-Learn Everything

Some Device_Info are merging in the result instead of one device_info per row it is two device_info per row

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Perhaps if you shared some of your real events and results and your SPL, we might be able to advise you further. Vague descriptions of the issue and fake data means we can only offer solutions based what you have provided, and to that extent, the solution provided does work (but only with the fake data you provided)!

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...