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!

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...

Application management with Targeted Application Install for Victoria Experience

Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...