<?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: Joining accelerated data models using tstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303708#M91350</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; | tstats summariesonly=t count from datamodel=DM1 
     where (nodename=NODE1) by _time nodename
     | rename count as reccount
 | append
   [ | tstats summariesonly=t count from datamodel=DM2 
     where (nodename=NODE2) by _time nodename 
     | rename count as reccount]
 | append
   [ | tstats summariesonly=t count from datamodel=DM3 
     where (nodename=NODE3) by _time nodename 
     | rename count as reccount]
 | table _time nodename count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have all three series joined together you can graph them alongside each other, or if you just want to add all three kinds of events, you can run that through this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(reccount) as reccount by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;...and you could drop nodename out of most of the search that way.  &lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2017 22:45:42 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-02-14T22:45:42Z</dc:date>
    <item>
      <title>Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303707#M91349</link>
      <description>&lt;P&gt;Hi guys -&lt;/P&gt;

&lt;P&gt;I have 3 data models, all accelerated, that I would like to join for a simple count of all events (dm1 + dm2 + dm3) by time.&lt;/P&gt;

&lt;P&gt;3 single tstats searches works perfectly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Search 1
| tstats summariesonly=t count from datamodel=DM1 where (nodename=NODE1) by _time

Search 2
| tstats summariesonly=t count from datamodel=DM2 where (nodename=NODE2) by _time

Search 3
| tstats summariesonly=t count from datamodel=DM3 where (nodename=NODE3) by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, I'm not quite sure of how (and what the recommended approach) to join by count them is. Join, append, multisearch, eval, etc are all failing me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 18:16:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303707#M91349</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2017-02-14T18:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303708#M91350</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | tstats summariesonly=t count from datamodel=DM1 
     where (nodename=NODE1) by _time nodename
     | rename count as reccount
 | append
   [ | tstats summariesonly=t count from datamodel=DM2 
     where (nodename=NODE2) by _time nodename 
     | rename count as reccount]
 | append
   [ | tstats summariesonly=t count from datamodel=DM3 
     where (nodename=NODE3) by _time nodename 
     | rename count as reccount]
 | table _time nodename count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have all three series joined together you can graph them alongside each other, or if you just want to add all three kinds of events, you can run that through this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats sum(reccount) as reccount by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;...and you could drop nodename out of most of the search that way.  &lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 22:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303708#M91350</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-14T22:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303709#M91351</link>
      <description>&lt;P&gt;using the append command runs into sub search limits. You should use the prestats and append flags for the tstats command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats prestats=t summariesonly=t count from datamodel=DM1 where (nodename=NODE1) by _time, nodename | tstats prestats=t summariesonly=t append=t count from datamodel=DM2 where (nodename=NODE2) by _time, nodename | tstats prestats=t summariesonly=t append=t count from datamodel=DM3 where (nodename=NODE3) by _time, nodename | stats count by _time, nodename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 00:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303709#M91351</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-02-15T00:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303710#M91352</link>
      <description>&lt;P&gt;I downvoted this post because not a valid solutions, tstats has to be at the beginning of the search pipeline.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 02:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303710#M91352</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2017-02-15T02:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303711#M91353</link>
      <description>&lt;P&gt;DalJeanis version should work with some tweaking. To use tstats in this manner, it has to be in the beginning of the search pipeline. There should be some concern around the append and maximum number of events that it will return. For large datasets, this could be an issue..&lt;/P&gt;

&lt;P&gt;Here's an example search using _internal..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=_internal AND sourcetype=mongod by sourcetype 
| append 
    [| tstats count where index=_internal AND sourcetype=scheduler by sourcetype] 
| append 
    [| tstats count where index=_internal AND sourcetype=splunkd by sourcetype ] 
| append 
    [| tstats count where index=_internal AND sourcetype=splunk_version by sourcetype ]
| stats list(sourcetype) as ST dc(sourcetype) as st_DC 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For accelerated models, you should use the summariesonly=t for best results...&lt;/P&gt;

&lt;P&gt;This will be super fast! Love it...&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 02:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303711#M91353</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2017-02-15T02:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303712#M91354</link>
      <description>&lt;P&gt;I had originally pasted the actual command without the append=t. That has been fixed.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 13:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303712#M91354</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-02-15T13:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303713#M91355</link>
      <description>&lt;P&gt;It is a valid solution. I just failed to paste the copy with the append=t in the search example though I mentioned it in the comment. I have fixed the example.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 13:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303713#M91355</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-02-15T13:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303714#M91356</link>
      <description>&lt;P&gt;No, I'm pretty sure this does work, as long as you're willing to live with &lt;CODE&gt;prestats=true&lt;/CODE&gt;.  Try this on for size:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats prestats=true count where index=_internal by index 
| tstats prestats=true append=true count where index=* by index 
| stats count by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 13:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303714#M91356</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2017-02-15T13:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303715#M91357</link>
      <description>&lt;P&gt;Ok I reupvoted &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 14:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303715#M91357</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2017-02-15T14:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303716#M91358</link>
      <description>&lt;UL&gt;
&lt;LI&gt;1 thanks! This works.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303716#M91358</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2017-02-15T15:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303717#M91359</link>
      <description>&lt;P&gt;This solution also works (cannot mark 2 answers as correct, sadly). Thanks to the awesome Answers Community, as always.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303717#M91359</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2017-02-15T15:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303718#M91360</link>
      <description>&lt;P&gt;This solution also works (cannot mark 2 answers as correct, sadly). Thanks to the awesome Answers Community, as always.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303718#M91360</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2017-02-15T15:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303719#M91361</link>
      <description>&lt;P&gt;True though technically one that gets around the append command susbearch/limits is 'more correct' for larger data sets &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303719#M91361</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-02-15T15:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Joining accelerated data models using tstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303720#M91362</link>
      <description>&lt;P&gt;&lt;IMG src="http://i.imgur.com/gRk1uZm.gif" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-accelerated-data-models-using-tstats/m-p/303720#M91362</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2017-02-15T15:38:44Z</dc:date>
    </item>
  </channel>
</rss>

