<?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 use tstats where with structured data source? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614388#M213505</link>
    <description>&lt;P&gt;I think that message appears because of the minor breakers in the IP address.&amp;nbsp; Try overriding that with the &lt;FONT face="courier new,courier"&gt;TERM&lt;/FONT&gt; operator.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count where TERM(IP=10.0.0.1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 20:47:02 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-09-23T20:47:02Z</dc:date>
    <item>
      <title>How to use tstats where with structured data source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614367#M213489</link>
      <description>&lt;P&gt;tstats shows an error if I include a JSON field in "where" clause. &amp;nbsp;Same happens to CSV fields. &amp;nbsp;For example, if my source is like&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;{"host": "&amp;lt;hostname&amp;gt;", "IP": "&amp;lt;IP address&amp;gt;"}&lt;/P&gt;&lt;P&gt;and I do a search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count where IP = 10.0.0.1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk displays "&lt;SPAN&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;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem with &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Fieldsconf" target="_blank" rel="noopener"&gt;fields.conf&lt;/A&gt; is that it doesn't deal with original data structure. &amp;nbsp;With JSON, there is always a chance that regex will not properly capture a field. &amp;nbsp;With CSV, failure rate is even higher.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there some way to do tstats with structured sources? (I notice that despite the warning, tstats still performs OK. &amp;nbsp;But I'd rather users don't see such error message.)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614367#M213489</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-23T18:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tstats where with structured data source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614388#M213505</link>
      <description>&lt;P&gt;I think that message appears because of the minor breakers in the IP address.&amp;nbsp; Try overriding that with the &lt;FONT face="courier new,courier"&gt;TERM&lt;/FONT&gt; operator.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count where TERM(IP=10.0.0.1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 20:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614388#M213505</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-09-23T20:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tstats where with structured data source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614389#M213506</link>
      <description>&lt;P&gt;This sounds like a good use case for datamodels.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 20:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614389#M213506</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-09-23T20:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tstats where with structured data source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614400#M213509</link>
      <description>&lt;P&gt;TERM will not be usable if multiple JSON paths have a node named IP. &amp;nbsp;With CSV, it's even harder, if at all possible, to define a TERM. &amp;nbsp;I will explore &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Datamodel#datamodel" target="_blank" rel="noopener"&gt;datamodel&lt;/A&gt;&amp;nbsp;as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;&amp;nbsp;suggested.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 23:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-tstats-where-with-structured-data-source/m-p/614400#M213509</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-23T23:08:24Z</dc:date>
    </item>
  </channel>
</rss>

