Alerting

How to get most recent event(based on message) and compare with other events and return the result with latest timestamp

prathyusha89
New Member

Let's say, we have 3 different events ( 2 with Failure messages and 1 with reconfigured message) based on the service name and timestamp.

Event 1 : 
2022-07-25 08:29:38.516 service_name=addtocart message=failure
Event 2:
2022-07-25 08:29:35.516 service_name=addtocart message=reconfigured
Event 3:
2022-07-25 08:29:30.516 service_name=addtocart message=failure

Output should be as :
Which service is failed and not reconfigured again based on the latest timestamp

_timeservice_namemessage
2022-07-25 08:29:38.516addtocartfailure
Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The dedup command will return the most recent event with distinct value of a given field.  For example,

| dedup service_name

 will return the latest message from the addtocart service, which is the desired event from the example.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...