<?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: Can I run another search based on the results of a previous search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180930#M52143</link>
    <description>&lt;P&gt;it is not working well, i want to search the process was killed in typesouce ps, but i can't do it&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2015 19:37:06 GMT</pubDate>
    <dc:creator>mbenitezr</dc:creator>
    <dc:date>2015-03-24T19:37:06Z</dc:date>
    <item>
      <title>Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180925#M52138</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I want to search the command "kill" on source &lt;STRONG&gt;bash_command=kill&lt;/STRONG&gt;* and search the process from &lt;STRONG&gt;sourcetype=ps&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 17:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180925#M52138</guid>
      <dc:creator>mbenitezr</dc:creator>
      <dc:date>2015-03-19T17:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180926#M52139</link>
      <description>&lt;P&gt;I think this post may help you.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/89845/filter-search-results-based-on-return-value-of-subsearch.html"&gt;http://answers.splunk.com/answers/89845/filter-search-results-based-on-return-value-of-subsearch.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 18:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180926#M52139</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2015-03-19T18:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180927#M52140</link>
      <description>&lt;P&gt;Yes, you would use a subsearch. The subsearch is evaluated first, and is treated as a boolean AND to your base search.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;sourcetype=ps [search bash_command=kill* | fields ps]&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2015 20:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180927#M52140</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-19T20:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180928#M52141</link>
      <description>&lt;P&gt;hello again,&lt;/P&gt;

&lt;P&gt;I have this:&lt;/P&gt;

&lt;P&gt;(sourcetype=ps) | search [search bash_command=kill* | rex field=bash_command "kill (?.+[0-9])" | dedup PID |fields PID ]&lt;/P&gt;

&lt;P&gt;But don't work, i now i need split PID, but, i want first somo data&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;thanks a lot&lt;/STRONG&gt; to rob_jordan and masonmorales&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180928#M52141</guid>
      <dc:creator>mbenitezr</dc:creator>
      <dc:date>2020-09-28T19:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180929#M52142</link>
      <description>&lt;P&gt;Glad it worked out. Could you click "Accept Answer" please?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 18:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180929#M52142</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-24T18:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180930#M52143</link>
      <description>&lt;P&gt;it is not working well, i want to search the process was killed in typesouce ps, but i can't do it&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 19:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180930#M52143</guid>
      <dc:creator>mbenitezr</dc:creator>
      <dc:date>2015-03-24T19:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180931#M52144</link>
      <description>&lt;P&gt;Could you post sample data from each source please?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 20:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180931#M52144</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-24T20:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180932#M52145</link>
      <description>&lt;P&gt;Note: the the subsearch (child search) will append PID=### to the primary (parent search) where ### is the PID digits. If the parent search does not know what the field PID is, it won't work. I made some minor tweaks to the regex. Also typesource should be "sourcetype".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ps [ search bash_command=kill* | rex field=bash_command "kill\s+(?&amp;lt;PID&amp;gt;\d+)" | dedup PID | fields PID ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you could do a manual test of the primary search by hard coding the PID you are looking for as a test. If the manual test doesn't work, then the dynamic sub search won't work.&lt;/P&gt;

&lt;P&gt;i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ps PID="###"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternate search which will just search for the PID as a string instead of as a field. Might result in false positive matches.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ps [ search bash_command=kill* | rex field=bash_command "kill\s+(?&amp;lt;PID&amp;gt;\d+)" | dedup PID | fields PID | rename PID as search ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More or less equivalent to a manual search of&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ps "###"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2015 16:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180932#M52145</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2015-03-25T16:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180933#M52146</link>
      <description>&lt;P&gt;you just have change typesource for sourcetype&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 22:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180933#M52146</guid>
      <dc:creator>mbenitezr</dc:creator>
      <dc:date>2015-03-27T22:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180934#M52147</link>
      <description>&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 22:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180934#M52147</guid>
      <dc:creator>mbenitezr</dc:creator>
      <dc:date>2015-03-27T22:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run another search based on the results of a previous search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180935#M52148</link>
      <description>&lt;P&gt;Yes, sorry, I thought "typesource" was a field extraction that you had. If your sourcetype is called "ps" then it is "sourcetype=ps [search bash_command=kill* | fields ps]" &lt;/P&gt;

&lt;P&gt;My apologies for any confusion that may have caused.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 23:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-run-another-search-based-on-the-results-of-a-previous/m-p/180935#M52148</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-27T23:15:12Z</dc:date>
    </item>
  </channel>
</rss>

