Refine your search:

2
1

I'd like to build a "Recent Alerts" report listing which alerts have been fired by Splunk in the last few days.

When a splunk alert is fired, I'm assuming there's an event written somewhere in the _internal index which I can use for this. Anyone know what search query I should be using to pull out these events from Splunk's internal logs?

BTW, this report will be useful for several reasons, including:

  • troubleshooting problems with our alert scripts (e.g. alert fired but alert script didn't do what we thought it should)
  • giving folks outside the ops team a view into the problems the ops team is working on
  • providing a failsafe option if email is down

asked 28 Feb '10, 13:19

Justin%20Grant's gravatar image

Justin Grant
1.5k6740
accept rate: 50%

edited 01 Mar '10, 18:24

hulahoop's gravatar image

hulahoop ♦
2.5k3240


3 Answers:

I use the following search on the _internal index in version 4.1+ to report on alerts that have been triggered:

index="_internal" sourcetype="scheduler" thread_id="AlertNotifier*" NOT (alert_actions="summary_index" OR alert_actions="")

I am excluding summary_index alert actions since I am only interested in "real" alerts and not summary index searches. You can easily build a report based on the results of this search. Especially if you use splunk for PCI compliance having a report showing all alerts fired over a period of time will go a long way to help you satisfy the daily log review requirement.

link

answered 29 Jun '10, 14:00

ftk's gravatar image

ftk ♦
6.2k419
accept rate: 37%

4.0 doesn't have terribly good log events for alerting. You can see that the search was run, but not that it was run by the scheduler, so you cannot differentiate between manually-initiated and schedule-initiated searches. You can see the python event if the search eventually fires the email sending command sendemail.py, but that only will catch searches whose conditions were met, and which were configured to send email.

In 4.1, all scheduled searches are explicitly logged, as well as the result (conditions met / not met). If a search would have run but was not for some reason, this is also logged. There are some built-in status views that try to give useful reporting on this data, but you can build your own slicings of it.

link

answered 11 Mar '10, 08:46

jrodman's gravatar image

jrodman ♦
5.8k2515
accept rate: 42%

You can also use the following search:

index=_audit action=alert_fired

which has the added benefit of giving you the expiration time and the severity. For example, you could create a report of the currently active alerts like this:

index=_audit action=alert_fired | eval ttl=expiration-now() | search ttl>0 | convert ctime(trigger_time) | table trigger_time ss_name severity
link

answered 23 Jun '11, 06:31

alexiri's gravatar image

alexiri
614
accept rate: 33%

edited 23 Jun '11, 08:32

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×172
×103
×8

Asked: 28 Feb '10, 13:19

Seen: 1,094 times

Last updated: 23 Jun '11, 08:33

Copyright © 2005-2012 Splunk, Inc. All rights reserved.