Splunk Search

How can i efficiently discard the event stream of a search?

jrodman
Splunk Employee
Splunk Employee

Suppose I have a search such as

sourcetype=apache errors

which finds errors that I care about. Now, suppose I want to send these errors, on certain conditions, so I want to use the alert_condition feature of savedsearches.conf. Let's say the condition I want to use is that it is not working hours -- totally unrelated to the original search. However, alert_condition is fed the event stream from the original search.

How can I efficiently dump the original stream, when needed?

The best I can come up with is

alert_condition = head 1 | where 1=2 | append [search ....]

Can this be done more neatly?

Tags (3)
1 Solution

jrodman
Splunk Employee
Splunk Employee

Apparently the 'best I could come up with' is the best we have.

That should be efficient, it's just a little ugly to read.

View solution in original post

jrodman
Splunk Employee
Splunk Employee

Apparently the 'best I could come up with' is the best we have.

That should be efficient, it's just a little ugly to read.

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...