<?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: Tstats where error in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646279#M223704</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257555"&gt;@Imhim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have three choices:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;don't use tstats: if you have few events it's the easiest solution,&lt;/LI&gt;&lt;LI&gt;add o_wp to indexed fields, it's possible following the procedure at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.0.2209/Data/Configureindex-timefieldextraction" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.0.2209/Data/Configureindex-timefieldextraction&lt;/A&gt;&amp;nbsp;,&lt;/LI&gt;&lt;LI&gt;use a summary index: following the process described at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutsummaryindexing" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutsummaryindexing&lt;/A&gt;&amp;nbsp;,&lt;/LI&gt;&lt;LI&gt;create a DataModel containing all the fields you need for this search (and eventually also others) following the process at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatamodels" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatamodels&lt;/A&gt;&amp;nbsp;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The best solution depends on your requirements: if you need performaces with many events you can use DataModels or Summary indexes.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 08:49:18 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-06-08T08:49:18Z</dc:date>
    <item>
      <title>Can I fix this tstats where error?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646267#M223700</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i have this search:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;| tstats prestats=true count WHERE index=*_ot (source="*sgre*" OR o_wp="*sgre*") AND (source="*how02*" OR o_wp="*how02*") BY _indextime 
| eval _time=_indextime  | timechart count span=1h&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which gives me the error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;When used for 'tstats' searches, the 'WHERE' clause can contain only indexed fields. Ensure all fields in the 'WHERE' clause are indexed. Properly indexed fields should appear in fields.conf.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone know the solution to this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 14:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646267#M223700</guid>
      <dc:creator>Imhim</dc:creator>
      <dc:date>2023-06-08T14:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Tstats where error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646268#M223701</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=*_ot (source="*sgre*" OR o_wp="*sgre*") AND (source="*how02*" OR o_wp="*how02*")
| stats count BY _indextime 
| eval _time=_indextime  
| timechart count span=1h&lt;/LI-CODE&gt;&lt;P&gt;Or ensure all fields, e.g.&amp;nbsp; o_wp are indexed fields (going forward)&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646268#M223701</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-06-08T07:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Tstats where error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646269#M223702</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257555"&gt;@Imhim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can use tstats only on indexed fields, in your case o_wp shouldn't be an indexed field.&lt;/P&gt;&lt;P&gt;This means thatr you cannot use tstats for this search or add o_wp to the indexed fields.&lt;/P&gt;&lt;P&gt;or put all the fields you need for this dataset in a DataModel and use the datamodel for your search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646269#M223702</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-08T07:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Tstats where error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646270#M223703</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it needs to be an indexed field, then what would be the optimal approach to this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Br,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imhim&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 07:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646270#M223703</guid>
      <dc:creator>Imhim</dc:creator>
      <dc:date>2023-06-08T07:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Tstats where error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646279#M223704</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257555"&gt;@Imhim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have three choices:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;don't use tstats: if you have few events it's the easiest solution,&lt;/LI&gt;&lt;LI&gt;add o_wp to indexed fields, it's possible following the procedure at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.0.2209/Data/Configureindex-timefieldextraction" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.0.2209/Data/Configureindex-timefieldextraction&lt;/A&gt;&amp;nbsp;,&lt;/LI&gt;&lt;LI&gt;use a summary index: following the process described at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutsummaryindexing" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutsummaryindexing&lt;/A&gt;&amp;nbsp;,&lt;/LI&gt;&lt;LI&gt;create a DataModel containing all the fields you need for this search (and eventually also others) following the process at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatamodels" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatamodels&lt;/A&gt;&amp;nbsp;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The best solution depends on your requirements: if you need performaces with many events you can use DataModels or Summary indexes.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 08:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646279#M223704</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-08T08:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Tstats where error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646287#M223706</link>
      <description>&lt;P&gt;Thank you. I appreciate it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 09:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-fix-this-tstats-where-error/m-p/646287#M223706</guid>
      <dc:creator>Imhim</dc:creator>
      <dc:date>2023-06-08T09:16:43Z</dc:date>
    </item>
  </channel>
</rss>

