Splunk Search

Compare current and last one hour event value in same search.

vaibhavvijay9
New Member

Hi All,

I have to monitor the queues. And for that I have made the basic dashboard where it shows the details. Details are like : queueName, inTotalMsgs, outTotalMsgs, pendingMsgCount and dedup the queueName.

Now, what I want is (another search [new]): "If the current pendingMsg count is greater than or equal to the last one hour count, then display the queueName with label - 'Queue with no processing since last one hour' "
(OR we can say the outTotalMsgs is same for now and last one hour event)

Example :
My basic new search no dedup applied, but currently I have written only one queueName :

..... | xmlkv | table _time, qName, pendingMsgCount, inTotalMsgs, outTotalMsgs

Timestamp (last 60 minutes) - (22/02/2019 06:58:00.000 to 22/02/2019 07:58:13.000)

Results : only one queueName (124 events)

  • first two :
    alt text

  • last two :
    alt text

So, for this queueName, the pendingMsg count is same and hence it should be displayed in results for dashboard - 'Queue with no processing since last one hour'.

I am not able to achieve this, please help!

Thanks in advance!

0 Karma

renjith_nair
Legend

@vaibhavvijay9 ,

Try

 | xmlkv | table _time, qName, pendingMsgCount, inTotalMsgs, outTotalMsgs|dedup _time,qName
 |sort _time,qName
 |streamstats last(pendingMsgCount) as prev current=f by qName
 |eval diff=pendingMsgCount-prev| where diff>=0

This should give you Q names which haven't processed in last hour

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...