Alerting

Check first and last events in particular transaction and schedule alert

vineela
Path Finder

I am new to splunk. Please help me with the below content.
I need to check first and last events of particular transaction and alert should be triggered if the sequence is not followed or any process stopped in middle.
How can i do that ?
Can anyone please help me on the same?
Thanks in Advance

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If all the events for the same transaction have the same unique transaction id, it is easy to use that as the correlation id to gather events together. Then check to see if the last event meets your criteria for an alert to be raised.

0 Karma

vineela
Path Finder

yes,all events have unique transaction id .Can you please tell me the query how to correlate all the events based on it and check if the last event is not success

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
--- search ---
| stats latest(event) as last_event earliest(event) as first_event by transactionid

event is the field you want to check and transactionid is your correlation id. stats will remove everything not mentioned from the pipeline, so if there are other field you are interested in, they need to be included in the stats command to e.g. latest(otherfield) as last_otherfield

Note that the latest and earliest functions behave slightly differently in different releases of splunk, so you may need to sort by _time first or possibly use last and first functions instead or possibly both of these.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @vineela,

could you share some sample of your logs?

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...