<?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 How can I speed up a search by creating a data model using tstats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-speed-up-a-search-by-creating-a-data-model-using/m-p/373559#M109856</link>
    <description>&lt;P&gt;I want to speed up a search by creating a data model and using tstats.&lt;/P&gt;

&lt;P&gt;This is the search using the data model so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count from datamodel=WinEvents.Summary by _time, host, Summary.EventCode, Summary.SourceName, Summary.Type, Summary.Keywords span=1m | stats earliest(_time) as First latest(_time) as Last count by host, Summary.EventCode, Summary.SourceName,  Summary.Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the original search, I used eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval Type=if(Keywords=="Audit Success", Keywords, Type) | eval Type=if(Keywords=="Audit Failure", Keywords, Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since that is a complex aggregate function (according to the documentation), how do I make that work with tstats?&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2018 15:53:55 GMT</pubDate>
    <dc:creator>pil321</dc:creator>
    <dc:date>2018-02-12T15:53:55Z</dc:date>
    <item>
      <title>How can I speed up a search by creating a data model using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-speed-up-a-search-by-creating-a-data-model-using/m-p/373559#M109856</link>
      <description>&lt;P&gt;I want to speed up a search by creating a data model and using tstats.&lt;/P&gt;

&lt;P&gt;This is the search using the data model so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count from datamodel=WinEvents.Summary by _time, host, Summary.EventCode, Summary.SourceName, Summary.Type, Summary.Keywords span=1m | stats earliest(_time) as First latest(_time) as Last count by host, Summary.EventCode, Summary.SourceName,  Summary.Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the original search, I used eval:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval Type=if(Keywords=="Audit Success", Keywords, Type) | eval Type=if(Keywords=="Audit Failure", Keywords, Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since that is a complex aggregate function (according to the documentation), how do I make that work with tstats?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 15:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-speed-up-a-search-by-creating-a-data-model-using/m-p/373559#M109856</guid>
      <dc:creator>pil321</dc:creator>
      <dc:date>2018-02-12T15:53:55Z</dc:date>
    </item>
  </channel>
</rss>

