Splunk Search

How to create a timechart with the count of open events that did not have a closing event within a certain time frame?

lordadmiral
New Member

Hi there,

I have events which indicate opening and closing of an event. I want to see the amount of open events (that did not get a closing event by that time) at a given time.

Snipped from my search so far:

... | stats earliest(_time) as _time by processid, service, location | eval combkey = service." - ".processid | eval openclosed = if(location="o","close","open") | timechart...

I just have no idea how to achieve this.

Any idea is welcome 🙂

thanks
lordadmiral

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try like this

.. | stats earliest(_time) as _time by processid, service, location | eval openclosed = if(location="o",-1,1) | timechart sum(openclosed)

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try like this

.. | stats earliest(_time) as _time by processid, service, location | eval openclosed = if(location="o",-1,1) | timechart sum(openclosed)
0 Karma

lordadmiral
New Member

Thanks a lot somesoni2!

0 Karma

sundareshr
Legend

Have you tried ... | timechart span=15m count by openclosed

0 Karma

lordadmiral
New Member

Thanks for answering sundareshr! somesoni2´s answer did the trick. 😉

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...