<?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 Re: Is it possible to create an alert that does summary indexing and sends an email? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453552#M4018</link>
    <description>&lt;P&gt;you can use collect command for summary indexing your search results and sendemail command for sending the email of search result.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 16:23:21 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2018-10-26T16:23:21Z</dc:date>
    <item>
      <title>Is it possible to create an alert that does summary indexing and sends an email?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453551#M4017</link>
      <description>&lt;P&gt;We got a working solution using saved searches (summary indexer and alert sending email) that does something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Name: our_good_saved_search
# Schedule: runs every 30 minutes
# Type: Summary Indexing Saved Search
# Description: Basically, what below does is it'll get logs from a raw index, put them in a summary index if the same logs aren't in the summary index yet

index=our_raw_index sourcetype=our_logs earliest=-5d@w1
| dedup Some, Unique, Fields,
| table Some, Unique, Fields, Just, Another, Column
| join type=left Some, Unique, Fields
    [ search index=our_summary_index source=our_good_saved_search earliest=-5d@w1
    | eval Excluder = 1 ]
| where isnull(Excluder)
| eval _time = now()
| table _time, Some, Unique, Fields, Just, Another, Column

# Name: our_good_email_sender
# Schedule: 1,31 * * * *
# Type: Alert With Send Email Action
# Description: Basically, what below does is when it detects new items, it'll send emails for each of them

index=our_summary_index source=our_good_saved_search earliest=-29min@min-1s@s
| table _time, Some, Unique, Fields, Just, Another, Column
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We find it redundant since both are types of saved searches. We're wondering if it's possible that the whole thing can be done by just one alert basically like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=our_raw_index sourcetype=our_logs earliest=-5d@w1
| dedup Some, Unique, Fields,
| table Some, Unique, Fields, Just, Another, Column
| join type=left Some, Unique, Fields
    [ search index=our_summary_index source=our_good_email_sender earliest=-5d@w1
    | eval Excluder = 1 ]
| where isnull(Excluder)
| eval _time = now()
| table _time, Some, Unique, Fields, Just, Another, Column
| summaryindex ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Theoretically, the above code is an alert that would&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Summary index its result&lt;/LI&gt;
&lt;LI&gt;Send an email for each result. &lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I've already tried adding the &lt;CODE&gt;action_summary.index=1&lt;/CODE&gt; and &lt;CODE&gt;action.summary_index._name = our_summary_index&lt;/CODE&gt; configs but they're not working.&lt;/P&gt;

&lt;P&gt;If this is possible, please advise on what I am missing.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 15:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453551#M4017</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2018-10-26T15:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create an alert that does summary indexing and sends an email?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453552#M4018</link>
      <description>&lt;P&gt;you can use collect command for summary indexing your search results and sendemail command for sending the email of search result.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 16:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453552#M4018</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-10-26T16:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create an alert that does summary indexing and sends an email?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453553#M4019</link>
      <description>&lt;P&gt;You need not use the alert actions; you can do the same thing with SPL.  You can use &lt;CODE&gt;collect&lt;/CODE&gt; to send data to a summary index and you can use &lt;CODE&gt;sendemail&lt;/CODE&gt; to send results by email.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 01:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453553#M4019</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-11-08T01:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create an alert that does summary indexing and sends an email?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453554#M4020</link>
      <description>&lt;P&gt;Hi. Thanks for the "collect".. It's working. However, I can't get to pass a random string to the "file" argument. It says that we need to do file=randomstring_event.stash.&lt;/P&gt;

&lt;P&gt;How do you pass a random, say _time, there?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 08:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453554#M4020</guid>
      <dc:creator>morethanyell</dc:creator>
      <dc:date>2018-11-09T08:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to create an alert that does summary indexing and sends an email?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453555#M4021</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;marker&lt;/CODE&gt; and be aware that there has to be a comma and a space between the key=value pairs and if the value contains spaces or commas, it needs to be escape quoted. The stream should have an | addinfo included for the manual population of the index (backfill):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... Your Search Here
| addinfo
| collect index=mysummary marker="_time=foo, summary_span=3600, summary_method=bucket, search_name=\"vpn starts and stops\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Nov 2018 23:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Is-it-possible-to-create-an-alert-that-does-summary-indexing-and/m-p/453555#M4021</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-11-10T23:31:11Z</dc:date>
    </item>
  </channel>
</rss>

