<?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 search across three sourcetypes using stats, but without using join, append, or subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270456#M81406</link>
    <description>&lt;P&gt;The fields were one to one mapped and this answer did actually work for me.&lt;/P&gt;

&lt;P&gt;Coming back to mark as the answer and say thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 21:27:05 GMT</pubDate>
    <dc:creator>chrisw3</dc:creator>
    <dc:date>2017-10-25T21:27:05Z</dc:date>
    <item>
      <title>How to search across three sourcetypes using stats, but without using join, append, or subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270452#M81402</link>
      <description>&lt;P&gt;I'm currently working on 3 separate data sourcetypes that have similar information&lt;/P&gt;

&lt;P&gt;Sourcetype 1 - Fields X,Y,Z&lt;BR /&gt;
Sourcetype 2 - Fields A,Z&lt;BR /&gt;
Sourcetype 3 - Fields A,B,C&lt;/P&gt;

&lt;P&gt;I'd like to search across these 3 sourcetypes and collect stats information for things like Field X by Field B or C, but I'm struggling with how to complete this search without defaulting back to using joins, appends, subsearches, or some other suboptimal method.&lt;/P&gt;

&lt;P&gt;I was trying the following search but kept running into the issue that only sourcetype 2 had both fields A &amp;amp; Z and the other sourcetypes would be dropped and my interesting fields with it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=1) OR (sourcetype=2) OR (sourcetype=3) 
| stats values(*) as * by A,Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also attempted to add a fillnull command, but was still met with a lack of interesting fields correlating correctly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=1) OR (sourcetype=2) OR (sourcetype=3) 
| fillnull A,Z
| stats values(*) as * by A,Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The ultimate Goal is to have a table that lists a single row with X,Y,Z,A,B,C.  From there I can begin to manipulate into other relevant stats, but I just can't figure out how to make that happen without using a join.&lt;/P&gt;

&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 23:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270452#M81402</guid>
      <dc:creator>chrisw3</dc:creator>
      <dc:date>2016-12-09T23:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to search across three sourcetypes using stats, but without using join, append, or subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270453#M81403</link>
      <description>&lt;P&gt;Hi chrisw3,&lt;/P&gt;

&lt;P&gt;the easiest way to get what you want is to use the &lt;CODE&gt;max()&lt;/CODE&gt; option with &lt;CODE&gt;stats&lt;/CODE&gt; but since you did not provide enough information on your actual use case, I don't know if this will work for you or not. But you can try this run everywhere search to get an idea who it works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd OR sourcetype=splunkd_access OR sourcetype=splunk_ui_access | stats max(*) AS *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will list you all max values for all fields from all source types on one row.&lt;/P&gt;

&lt;P&gt;Maybe it's worth to check this answer as well &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to get more ideas how to solve this problem. This answer is expandable to more sources / sourcetypes / indexes &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2016 08:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270453#M81403</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-12-10T08:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to search across three sourcetypes using stats, but without using join, append, or subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270454#M81404</link>
      <description>&lt;P&gt;Clarifying the stats command done in the search since it looks like it didn't paste properly...&lt;/P&gt;

&lt;P&gt;(sourcetype=1) OR (sourcetype=2) OR (sourcetype=3) &lt;BR /&gt;
| stats values(*) as * by A,Z&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 16:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270454#M81404</guid>
      <dc:creator>chrisw3</dc:creator>
      <dc:date>2016-12-12T16:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to search across three sourcetypes using stats, but without using join, append, or subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270455#M81405</link>
      <description>&lt;P&gt;Assuming, field A and Z have one to one mapping, give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype=1) OR (sourcetype=2) OR (sourcetype=3) 
| eventstats values(A) as A_common by Z | eval A=coalesce(A,A_common) 
| eventstats values(Z) as Z_common by A | eval Z=coalesce(Z,Z_common)
| stats values(*) as by A,Z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Dec 2016 17:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270455#M81405</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-12T17:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search across three sourcetypes using stats, but without using join, append, or subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270456#M81406</link>
      <description>&lt;P&gt;The fields were one to one mapped and this answer did actually work for me.&lt;/P&gt;

&lt;P&gt;Coming back to mark as the answer and say thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:27:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-across-three-sourcetypes-using-stats-but-without/m-p/270456#M81406</guid>
      <dc:creator>chrisw3</dc:creator>
      <dc:date>2017-10-25T21:27:05Z</dc:date>
    </item>
  </channel>
</rss>

