Splunk Search

Identify which power meter reading has stopped increasing for 5 days

splunk_rookie
Engager

Hi, I am trying to identify which power meter reading has stopped increasing for 5 days. 

As these power values are accumulated, I assumed that they are always in sequential order with respect to time. Therefore, I sorted the data by ASSET_NAME and _time to get the latest value. Then I took the difference between the latest value for every 5 days. So if the difference is 0, it means that there is no power increment.

Do you think that this logic flow is correct? Below is my code:

 

| bucket _time span=5d

| sort 0 ASSET_NAME _time

| stats latest(VALUE) as latestValue by ASSET_NAME _time

| delta latestValue as difference

| search difference = 0

 

Also, let's say the power values are not in sequential order due to some issue, how can I accurately identify the  power meter that has stopped increasing?

Please help. Thank you! 🙂

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Rather than latest, how about using max()?

0 Karma

splunk_rookie
Engager

I get the same result as using latest ()

Anyway, I came up with another solution. First I sorted by ASSET_NAME and _time, then I used delta to find the power difference between each consecutive events. Next i used delta again to find the duration between the two events. Lastly I searched for power difference = 0 and duration > 432000 sec (5days). 

0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...