<?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: How to append the results of one search to another? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205470#M59737</link>
    <description>&lt;P&gt;hmmm I'm not sure if those would work, basically I want to run those two searches and add the results together, not match or overwrite anything (which is by my understating what appendcols and join do). Here is an example, Thank you!&lt;/P&gt;

&lt;P&gt;Search 1 Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
1                  2                01/01/16&lt;BR /&gt;
2                  5                02/01/16&lt;/P&gt;

&lt;P&gt;Search 2 Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
3                  3                12/01/15&lt;BR /&gt;
4                  5                11/01/15&lt;/P&gt;

&lt;P&gt;Desired Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
1                  2                01/01/16&lt;BR /&gt;
2                  5                02/01/16&lt;BR /&gt;
3                  3                12/01/15&lt;BR /&gt;
4                  5                11/01/15&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2016 22:30:40 GMT</pubDate>
    <dc:creator>raby1996</dc:creator>
    <dc:date>2016-02-16T22:30:40Z</dc:date>
    <item>
      <title>How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205468#M59735</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm using the search below to collect errors that have occurred on specific machines, however, I need to use two different searches because the data is split amongst two indexes and source types. When I try using the append command, I only get the results of the first search. Is there any reason as to why this may happening? Thank you in advance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=hb_probtxt or hb_probxml  sourcetype=AllProblems.txt or AllProblems.xml eventtype=nix_errors
     | rex "(?m)storageFacilityMTMS.*?=(?&amp;lt;sf&amp;gt;\S+)"
     | rex "(?m)referenceCode.*?=(?&amp;lt;rc&amp;gt;BE\w+)"
     | rex  field=firstReportedTime "(?&amp;lt;cf&amp;gt;\S+\s+\S+)"
     | dedup sf, rc, cf
     | stats list(rc) as "SRC Code"  list(firstReportedTime) as "Date of Occurence" by sf| rename sf as "MTMS"
     |append [search index=hb_probxml  sourcetype="AllProblems.xml" 
     | rex "(?m)storageFacilityMTMS.*?\"(?&amp;lt;sf&amp;gt;.*?)\""
     | rex "(?m) referenceCode.*?\"(?&amp;lt;rc&amp;gt;.*?)\""
     |  rex "(?m)SEText.*?\"(?&amp;lt;st&amp;gt;.*?)\""
     | rex field=collectionTimeStamp "(?&amp;lt;cs&amp;gt;\w+)"
     | dedup cs, sf, rc
     | stats list(rc) as "SRC Code" list(collectionTimeStamp) as "Date of Occurence" by sf | rename sf as "MTMS" ]               
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205468#M59735</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-02-16T22:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205469#M59736</link>
      <description>&lt;P&gt;hi raby1996,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Appends&lt;/CODE&gt; the results of a subsearch to the current results. The &lt;CODE&gt;append&lt;/CODE&gt; command runs only over historical data and does not produce correct results if used in a &lt;CODE&gt;real-time&lt;/CODE&gt; search.&lt;/P&gt;

&lt;P&gt;try use &lt;CODE&gt;appendcols&lt;/CODE&gt; Or  &lt;CODE&gt;join&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205469#M59736</guid>
      <dc:creator>gyslainlatsa</dc:creator>
      <dc:date>2016-02-16T22:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205470#M59737</link>
      <description>&lt;P&gt;hmmm I'm not sure if those would work, basically I want to run those two searches and add the results together, not match or overwrite anything (which is by my understating what appendcols and join do). Here is an example, Thank you!&lt;/P&gt;

&lt;P&gt;Search 1 Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
1                  2                01/01/16&lt;BR /&gt;
2                  5                02/01/16&lt;/P&gt;

&lt;P&gt;Search 2 Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
3                  3                12/01/15&lt;BR /&gt;
4                  5                11/01/15&lt;/P&gt;

&lt;P&gt;Desired Results-&lt;BR /&gt;
MTMS  SRC Code   Date of Occurrence&lt;BR /&gt;
1                  2                01/01/16&lt;BR /&gt;
2                  5                02/01/16&lt;BR /&gt;
3                  3                12/01/15&lt;BR /&gt;
4                  5                11/01/15&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205470#M59737</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-02-16T22:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205471#M59738</link>
      <description>&lt;P&gt;I do not see any issue with your search here. It could be that append subsearch is getting timedout before it's complete. Also, just to be sure, try this to confirm you're not seeing any events from 2nd search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=hb_probtxt or hb_probxml  sourcetype=AllProblems.txt or AllProblems.xml eventtype=nix_errors
     | rex "(?m)storageFacilityMTMS.*?=(?&amp;lt;sf&amp;gt;\S+)"
     | rex "(?m)referenceCode.*?=(?&amp;lt;rc&amp;gt;BE\w+)"
     | rex  field=firstReportedTime "(?&amp;lt;cf&amp;gt;\S+\s+\S+)"
     | dedup sf, rc, cf
     | stats list(rc) as "SRC Code"  list(firstReportedTime) as "Date of Occurence" by sf| rename sf as "MTMS" | eval From=1
     |append [search index=hb_probxml  sourcetype="AllProblems.xml" 
     | rex "(?m)storageFacilityMTMS.*?\"(?&amp;lt;sf&amp;gt;.*?)\""
     | rex "(?m) referenceCode.*?\"(?&amp;lt;rc&amp;gt;.*?)\""
     |  rex "(?m)SEText.*?\"(?&amp;lt;st&amp;gt;.*?)\""
     | rex field=collectionTimeStamp "(?&amp;lt;cs&amp;gt;\w+)"
     | dedup cs, sf, rc
     | stats list(rc) as "SRC Code" list(collectionTimeStamp) as "Date of Occurence" by sf | rename sf as "MTMS"  | eval From=2 ] | where From=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205471#M59738</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-16T22:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205472#M59739</link>
      <description>&lt;P&gt;follow this link: &lt;A href="https://answers.splunk.com/answers/144351/what-are-the-differences-between-append-appendpipe.html"&gt;https://answers.splunk.com/answers/144351/what-are-the-differences-between-append-appendpipe.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:46:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205472#M59739</guid>
      <dc:creator>gyslainlatsa</dc:creator>
      <dc:date>2016-02-16T22:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the results of one search to another?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205473#M59740</link>
      <description>&lt;P&gt;Yes I think that was the Problem, I ended up searching multiple indexes using the OR boolean, and its working. I appreciate the help, however I was required to delete the posting, still Thank You!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 22:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-results-of-one-search-to-another/m-p/205473#M59740</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2016-02-16T22:56:33Z</dc:date>
    </item>
  </channel>
</rss>

