Splunk Search

If Then? Can this be done with Splunk

pwjohnston79
New Member

First off, I’m not very strong in the scripting so If Then might not even be what I need to use. I thought Splunk just searched for errors, but I’ve been told to search for this.

I have a process that spits out a log with this entry
ApprovalExecutionJob:22 - BEGIN::Processing Approval Requests
It runs ever 15 min (0,15,30,45).

It takes about 5 min and then spit out this:
ApprovalExecutionJob:37 - END::Processing Approval Requests

If it does not produce this END process notice then we need to be notified. Can this be done in Splunk?

Tags (1)
0 Karma

lukejadamec
Super Champion

If What > What Then. You need something in the logs that links the two events. Your example of events does not show a link.

0 Karma

kphillipson
Path Finder

I have asked a question like this one. This might be of use.
http://answers.splunk.com/answers/84271/transaction-two-logs-alert-if-orphaned-for-30-mins

0 Karma

kristian_kolb
Ultra Champion

Yes, it can probably be performed in some way or another. Is the '22' and '37' some unique job ID's (or at least unique enough for the purpose of the search, e.g. do not repeat more than daily)? Then you can search like this;

sourcetype=your_sourcetype | rex "ApprovalExecutionJob:(?\d+)" | stats count by JobID | where count < 2

There are other options like e.g. transaction which may also be useful.

/K

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...