<?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: Multiple Searches for an Alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490072#M12772</link>
    <description>&lt;P&gt;As others have said, you can use a &lt;CODE&gt;subsearch&lt;/CODE&gt; which probably is the correct way.  You can also use &lt;CODE&gt;map&lt;/CODE&gt; which is the converse of &lt;CODE&gt;subsearch&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2019 18:11:12 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-27T18:11:12Z</dc:date>
    <item>
      <title>Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490064#M12764</link>
      <description>&lt;P&gt;Hello. I want to combine more than one search in order to create an alert. For example - I currently have a search(alert) running that looks for when a specific process name is launched. After that search brings backs results, I get an alert. I then have to manually log into Splunk and run other searches based off data in the original process name launch alert to finally get to the data I am looking for.&lt;/P&gt;

&lt;P&gt;Is it possible to either somehow combine the other searches to work together or have Splunk automatically launch the other searches after it sees that this process name is launched in the original alert? &lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 17:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490064#M12764</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2019-11-25T17:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490065#M12765</link>
      <description>&lt;P&gt;Hi Johann,&lt;/P&gt;

&lt;P&gt;You could use join operation to combine two searches.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|first_search
|field1,field2,process_name
|join type=inner process_name
[search second_search
  |field3,field4]
  |table  field1,field2,field3,field4,process_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Both the searches should contain a common field to join i.e process_name in this case.&lt;/P&gt;

&lt;P&gt;Please accept and upvote if this helps&lt;/P&gt;

&lt;P&gt;Happy splunking!!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 18:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490065#M12765</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2019-11-25T18:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490066#M12766</link>
      <description>&lt;P&gt;Hello dindu! In my case, I need to run two additional searches after the first search triggers an event for that process. However, the two additional searches are searching different sourcetypes and different fields. The Process_name is not a part of the two other searches... is there still a way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 15:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490066#M12766</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2019-11-27T15:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490067#M12767</link>
      <description>&lt;P&gt;Hi,  @johann2017&lt;BR /&gt;
Yes, you can.&lt;BR /&gt;
You can search again from the first search result using a subsearch.&lt;BR /&gt;
An example is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index2 sourcetype=your_sourcetype2 [  search index=your_index sourcetype=your_sourcetype something | return $process_name]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you can provide specific log samples and sample results, I can write more detailed queries.&lt;/P&gt;

&lt;HR /&gt;

&lt;PRE&gt;&lt;CODE&gt;(source=WinRegistry (key_path="HKLM\\sam" OR key_path="HKLM\\security" OR registry_key_name=sam OR registry_key_name=security) user=svchost.exe )
OR (EventCode=4672 Account_Name!=dmon40) OR (EventCode=4624 Logon_Type=3 Authentication_Package!=Kerberos)
| stats values(_time) as _time values(_raw) as event values(Process_name) as Process_name dc(source) as source_count by host
| where source_count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you don't need a subsearch.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490067#M12767</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-27T16:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490068#M12768</link>
      <description>&lt;P&gt;Alright! Let me explain the below searches. If search #1 triggers an event, then I would somehow need searches #2 and #3 to automatically kick off immediately. Searches #2 and #3 would need to automatically fill in the host name that was returned from search #1 results. &lt;/P&gt;

&lt;P&gt;(1) First search that would need to be ran: &lt;STRONG&gt;source=WinRegistry key_path="HKLM\sam" OR key_path="HKLM\security" OR registry_key_name=sam OR registry_key_name=security user=svchost.exe&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;(2) Second search: &lt;STRONG&gt;host=$host$ EventCode=4672 Account_Name!=dmon40&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;(3) Third search: &lt;STRONG&gt;host=$host$ EventCode=4624 Logon_Type=3 Authentication_Package!=Kerberos&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490068#M12768</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-09-30T03:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490069#M12769</link>
      <description>&lt;P&gt;@johann2017 &lt;BR /&gt;
I edited the answer. please confirm.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490069#M12769</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-27T16:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490070#M12770</link>
      <description>&lt;P&gt;Ok I will test this out! &lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490070#M12770</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2019-11-27T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490071#M12771</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt; -  I tested this out and it appears to work! However it is very difficult to read. I had table, sort, and rename syntax in before (that I didn't provide in the searches I previously gave you) can this be added to make everything easier to read? See below for my original searches including the table, sort, and rename syntax that was missing....&lt;/P&gt;

&lt;P&gt;1: source=WinRegistry key_path="HKLM\sam" OR key_path="HKLM\security" OR registry_key_name=sam OR registry_key_name=security user=svchost.exe | sort -_time | table _time, host, user, process_image, registry_path, registry_key_name, registry_type | rename registry_path AS "Registry Path" registry_key_name AS "Registry Key Name" registry_type AS "Registry Type" host AS "Host" user AS "User" process_image AS "Process Image"&lt;/P&gt;

&lt;P&gt;2: host=$host$ EventCode=4672 Account_Name!="dmon40"  Account_Name!="dmon45" | sort -_time | table _time, Account_Name, Account_Domain, Security_ID, subject&lt;/P&gt;

&lt;P&gt;3: host=$host$ EventCode=4624 Logon_Type=3 Authentication_Package!=Kerberos |sort -_time | table _time, src user host, ,EventCode,Logon_Type,Authentication_Package,Logon_Process,signature | rename src AS "IP Source" host AS "Destination Machine" user AS "Account used in Source"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490071#M12771</guid>
      <dc:creator>johann2017</dc:creator>
      <dc:date>2020-09-30T03:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Searches for an Alert</title>
      <link>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490072#M12772</link>
      <description>&lt;P&gt;As others have said, you can use a &lt;CODE&gt;subsearch&lt;/CODE&gt; which probably is the correct way.  You can also use &lt;CODE&gt;map&lt;/CODE&gt; which is the converse of &lt;CODE&gt;subsearch&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 18:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Multiple-Searches-for-an-Alert/m-p/490072#M12772</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-27T18:11:12Z</dc:date>
    </item>
  </channel>
</rss>

