<?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: Base Query return 440 events, but stats result is 0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492064#M194276</link>
    <description>&lt;P&gt;@rkyadav ,&lt;/P&gt;

&lt;P&gt;I removed 'by SFDC', and it returned 1 row with result is 0 as well.&lt;/P&gt;

&lt;P&gt;I tried to escape the '=' in the query by '\m', and it returned result to me. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats count(eval(searchmatch("GET /jsup?m\=calibrationOrgDataV12*"))) as number by SFDC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why?&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 02:41:07 GMT</pubDate>
    <dc:creator>cheriemilk</dc:creator>
    <dc:date>2020-05-12T02:41:07Z</dc:date>
    <item>
      <title>Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492061#M194273</link>
      <description>&lt;P&gt;Hi team, &lt;BR /&gt;
I have  below query. The base query has 440 events returned, But when I use  stats command, tje number is 0. Does the because the special charaters in the string to be matched? How should I correct the string?&lt;/P&gt;

&lt;P&gt;(servername=pc* OR host=pc*) AND &lt;BR /&gt;
sourcetype=access_log_bizx AND &lt;BR /&gt;
"GET /jsup?m=calibrationOrgDataV12*" &lt;BR /&gt;
&lt;STRONG&gt;| stats count(eval(searchmatch("GET /jsup?m=calibrationOrgDataV12*"))) as number by SFDC&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492061#M194273</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-09-30T05:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492062#M194274</link>
      <description>&lt;P&gt;@cheriemilk ,&lt;BR /&gt;
by-clause will make this resolve. &lt;/P&gt;

&lt;P&gt;check out field by SFDC , this makes results vary as you have added "by SFDC" . Thats the reason event count does not match stats count. &lt;/P&gt;

&lt;P&gt;Try removing the "by SFDC " from your search query , it fetch the  results.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/Stats"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/Stats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;by-clause&lt;BR /&gt;
Syntax: BY &lt;BR /&gt;
Description: The name of one or more fields to group by. You cannot use a wildcard character to specify multiple fields with similar names. You must specify each field separately. The BY clause returns one row for each distinct value in the BY clause fields. If no BY clause is specified, the stats command returns only one row, which is the aggregation over the entire incoming result set.&lt;/P&gt;

&lt;P&gt;hope this is useful.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 09:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492062#M194274</guid>
      <dc:creator>rkyadav</dc:creator>
      <dc:date>2020-05-07T09:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492063#M194275</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; | stats count(eval(searchmatch("*calibrationOrgDataV12*"))) as number by SFDC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Searchmatch had you searching for &lt;BR /&gt;
"GET /jsup?m=calibrationOrgDataV12*" and "/jsup?m" is not a field name in your data.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 10:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492063#M194275</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-05-07T10:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492064#M194276</link>
      <description>&lt;P&gt;@rkyadav ,&lt;/P&gt;

&lt;P&gt;I removed 'by SFDC', and it returned 1 row with result is 0 as well.&lt;/P&gt;

&lt;P&gt;I tried to escape the '=' in the query by '\m', and it returned result to me. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats count(eval(searchmatch("GET /jsup?m\=calibrationOrgDataV12*"))) as number by SFDC
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 02:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492064#M194276</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-05-12T02:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492065#M194277</link>
      <description>&lt;P&gt;@jkat54 &lt;BR /&gt;
probably not as it works for me with other query before&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 02:42:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492065#M194277</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-05-12T02:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Base Query return 440 events, but stats result is 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492066#M194278</link>
      <description>&lt;P&gt;&lt;CODE&gt;searchmatch&lt;/CODE&gt; use REGEX.&lt;/P&gt;

&lt;P&gt;strings &lt;CODE&gt;GET /jsup?m\=calibrationOrgDataV12*&lt;/CODE&gt;  is match &lt;CODE&gt;GET /jsum=calibrationOrgDataV1&lt;/CODE&gt;&lt;BR /&gt;
not &lt;CODE&gt;?&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 03:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Base-Query-return-440-events-but-stats-result-is-0/m-p/492066#M194278</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-12T03:09:16Z</dc:date>
    </item>
  </channel>
</rss>

