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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...