<?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 can I use tstats to search event count comparing with last week a the same time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295359#M165639</link>
    <description>&lt;P&gt;The &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[search [|tstats&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;is seeing &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|tstats&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;as a subsearch of an empty subsearch. Remove the &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[search...]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and it should work:&lt;/P&gt;

&lt;P&gt;| tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m-1w latest=@m-1w by host | rename count as LastWeek&lt;BR /&gt;
 | appendcols [|tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m latest=@m by host | rename count as Today]&lt;BR /&gt;
 | table host LastWeek Today&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 15:35:44 GMT</pubDate>
    <dc:creator>myriadic</dc:creator>
    <dc:date>2017-10-12T15:35:44Z</dc:date>
    <item>
      <title>How can I use tstats to search event count comparing with last week a the same time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295358#M165638</link>
      <description>&lt;P&gt;I have a search that works with stats - but fail to work when using tstats..&lt;/P&gt;

&lt;P&gt;Here is the search with stats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m-1w latest=@m-1w | stats count by host | rename count as LastWeek
| appendcols [search index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m latest=@m | stats count by host | rename count as Today] 
| table host Today LastWeek
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since this search take some time - I thought that I should use tstats instead - but some how I can't make it work. The individual&lt;BR /&gt;
searches works - but not combined as subsearch as in this example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m-1w latest=@m-1w by host | rename count as LastWeek
| appendcols [search [|tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m latest=@m by host | rename count as Today]]
| table host LastWeek Today
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this search it only returns values for "LastWeek" - nothing for "Today", but the individual searches with tstast works without problems.&lt;/P&gt;

&lt;P&gt;Anyone with a clue?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 13:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295358#M165638</guid>
      <dc:creator>splunk_pn</dc:creator>
      <dc:date>2017-10-12T13:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use tstats to search event count comparing with last week a the same time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295359#M165639</link>
      <description>&lt;P&gt;The &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[search [|tstats&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;is seeing &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|tstats&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;as a subsearch of an empty subsearch. Remove the &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[search...]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and it should work:&lt;/P&gt;

&lt;P&gt;| tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m-1w latest=@m-1w by host | rename count as LastWeek&lt;BR /&gt;
 | appendcols [|tstats count where index=wineventlog sourcetype="xmlwineventlog:security" earliest=-15m@m latest=@m by host | rename count as Today]&lt;BR /&gt;
 | table host LastWeek Today&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 15:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295359#M165639</guid>
      <dc:creator>myriadic</dc:creator>
      <dc:date>2017-10-12T15:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use tstats to search event count comparing with last week a the same time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295360#M165640</link>
      <description>&lt;P&gt;Ok, thank you!&lt;BR /&gt;
I knew it was something simple - sometimes you need someone else eyes - to see the obvious...&lt;/P&gt;

&lt;P&gt;Thanka, again.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 06:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-tstats-to-search-event-count-comparing-with-last/m-p/295360#M165640</guid>
      <dc:creator>splunk_pn</dc:creator>
      <dc:date>2017-10-13T06:51:43Z</dc:date>
    </item>
  </channel>
</rss>

