<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trigger a report based on an event in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44529#M554</link>
    <description>&lt;P&gt;Is it possible (and how) to trigger a report to be run based on an event? I have a batch processor that logs to splunk. there are 2 types of events - 1 is job metadata, and the other is job run specifics:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;JOB METADATA action=start name=MyJob runId=foobar
JOB DETAIL id=1 action=update result=pass
JOB DETAIL id=2 action=update result=fail
JOB DETAIL id=3 action=delete result=pass
JOB DETAIL id=4 action=insert result=fail
JOB METADATA action=end name=MyJob duration=6300 runId=foobar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;given these events, I could create a saved search called FailedModifications that gives all the details where result!=pass. But I would only like to run this report for runId=foobar (runId actually uses a date/time stamp), and only run it once the job completes. Something along the lines of using this search: &lt;CODE&gt;eventtype=AJobAction action=end&lt;/CODE&gt; as a trigger for my "FailedModifications" saved search to run with an extra "runId" parameter. The FailedModifications search is configured as an alert that emails results (this is a requirement of what I'm trying to configure here).&lt;/P&gt;

&lt;P&gt;Currently, I'm scheduling the FailedModifications report to run on a cron schedule, with a window matching the schedule intervals, but this is not an ideal configuration. Possible with splunk? if so, how?&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2013 11:35:49 GMT</pubDate>
    <dc:creator>brettcave</dc:creator>
    <dc:date>2013-08-23T11:35:49Z</dc:date>
    <item>
      <title>Trigger a report based on an event</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44529#M554</link>
      <description>&lt;P&gt;Is it possible (and how) to trigger a report to be run based on an event? I have a batch processor that logs to splunk. there are 2 types of events - 1 is job metadata, and the other is job run specifics:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;JOB METADATA action=start name=MyJob runId=foobar
JOB DETAIL id=1 action=update result=pass
JOB DETAIL id=2 action=update result=fail
JOB DETAIL id=3 action=delete result=pass
JOB DETAIL id=4 action=insert result=fail
JOB METADATA action=end name=MyJob duration=6300 runId=foobar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;given these events, I could create a saved search called FailedModifications that gives all the details where result!=pass. But I would only like to run this report for runId=foobar (runId actually uses a date/time stamp), and only run it once the job completes. Something along the lines of using this search: &lt;CODE&gt;eventtype=AJobAction action=end&lt;/CODE&gt; as a trigger for my "FailedModifications" saved search to run with an extra "runId" parameter. The FailedModifications search is configured as an alert that emails results (this is a requirement of what I'm trying to configure here).&lt;/P&gt;

&lt;P&gt;Currently, I'm scheduling the FailedModifications report to run on a cron schedule, with a window matching the schedule intervals, but this is not an ideal configuration. Possible with splunk? if so, how?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 11:35:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44529#M554</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-08-23T11:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a report based on an event</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44530#M555</link>
      <description>&lt;P&gt;The main search looks like a transaction starting with action=start and finishing with action=end. I hope that you do not have multiple jobs in parallel, otherwise you need a field to join them, maybe the source...&lt;/P&gt;

&lt;P&gt;If you are using a scheduled search, you can have your report calculated every time, but only sent if a condition is met. (presence of action=end and of result=fail)&lt;/P&gt;

&lt;P&gt;it can be done by  a simple &lt;CODE&gt;| WHERE action=end AND of result=fail&lt;/CODE&gt;  condition at the very end of the search, and an alert based on "if number of results &amp;gt; 0".&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44530#M555</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-08-23T14:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a report based on an event</title>
      <link>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44531#M556</link>
      <description>&lt;P&gt;cool, thanks yannK. Will give it a try and post back.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2013 13:50:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Trigger-a-report-based-on-an-event/m-p/44531#M556</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-08-26T13:50:03Z</dc:date>
    </item>
  </channel>
</rss>

