Splunk Search

How to find first and last occurence of a value in a field when that value in the field gets changed?

Arminder_Bhalla
New Member

We have a requirement to count the total number of unscheduled outages in a month. The scenario is as follows:

1) We have monthly data available which has timestamp and a field “Status”. The values of Status is “S” for success and “F” for Failure.
2) The data should be monitored continuously for any failure occurred.
3) If any failure lasts for more than 5 mins, then it should be considered as an outage. But if failure is for less than 5 mins, then it should be ignored.
4) Similarly, while monitoring for failure, if any success occurs for less than 5 mins, then it should be ignored.

Please suggest any solution.

0 Karma

dcarmack_splunk
Splunk Employee
Splunk Employee

what does a cleared failure look like in the events?

0 Karma

ddrillic
Ultra Champion

I really like the transaction idea here ; -)

0 Karma

javiergn
Super Champion

I'm not a fan of the transaction command but it's probably going to help you a lot here. Link to docs.

What I would do on a very high level:

  • Create a transaction for the relevant sourcetype and restrict the timespan accordingly (1 month for instance)
  • Transaction should use the Status field to match consecutive events
  • Use maxspan=5m
  • Then filter the results by Status = F and create an alert based on the output

Hope that helps.

Thanks,
J

0 Karma
Get Updates on the Splunk Community!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...