<?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: Always got zero for count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520917#M146744</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt; still zero...&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 19:03:18 GMT</pubDate>
    <dc:creator>hongbo_miao</dc:creator>
    <dc:date>2020-09-22T19:03:18Z</dc:date>
    <item>
      <title>Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520398#M146524</link>
      <description>&lt;P&gt;I am trying to count the requests which `message.logType` is "Outgoing Response".&lt;/P&gt;&lt;P&gt;My query is like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"
| stats count as total, count(eval(message.logType="Outgoing Response")) as outgoingCount by log.request.url
| table log.request.url, total, outgoingCount
| sort -outgoingCount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My logs are like, they do have `message.logType` field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hongbo_miao_0-1600467638214.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10892iD0828EE7150F5B66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hongbo_miao_0-1600467638214.png" alt="hongbo_miao_0-1600467638214.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, the outgoingCount column is always 0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hongbo_miao_1-1600467744113.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10893i3421967FF679254C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hongbo_miao_1-1600467744113.png" alt="hongbo_miao_1-1600467744113.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I read &lt;A href="https://community.splunk.com/t5/Splunk-Search/stats-count-eval-always-returns-zero/m-p/334406" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/stats-count-eval-always-returns-zero/m-p/334406&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But does not help in my case.&lt;/P&gt;&lt;P&gt;Any idea? Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520398#M146524</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-18T22:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520399#M146525</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/50019"&gt;@hongbo_miao&lt;/a&gt;&amp;nbsp;, could you please check if you are running your search in fast mode? If yes, try running in verbose mode and see if you get the results.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520399#M146525</guid>
      <dc:creator>Nisha18789</dc:creator>
      <dc:date>2020-09-18T22:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520403#M146526</link>
      <description>&lt;P&gt;Can you try enclosing message.logType in single quotes?&lt;/P&gt;&lt;P&gt;and also try running search by removing sort command at the end. I believe there should be space between - and field name.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 04:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520403#M146526</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-19T04:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520428#M146543</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index" "Outgoing Response" | head 1&lt;/LI-CODE&gt;&lt;P&gt;in verbose mode and look to see what fields have been extracted&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10895iA43EEA3CB9ABE9A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2020 13:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520428#M146543</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-19T13:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520622#M146577</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; this is running&lt;/P&gt;&lt;PRE&gt;index="my_index" "Outgoing Response" | head 1&lt;/PRE&gt;&lt;P&gt;in verbose mode.&lt;/P&gt;&lt;P&gt;message.logType does in the field list.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="s.jpg" style="width: 462px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10913i9D3A9E2C722496BA/image-dimensions/462x522?v=v2" width="462" height="522" role="button" title="s.jpg" alt="s.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if I run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index" | search message.logType="Outgoing Response"&lt;/LI-CODE&gt;&lt;P&gt;It does return matched events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520622#M146577</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-21T14:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520623#M146578</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/50019"&gt;@hongbo_miao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; suggested, try enclosing the field name with dot "." in single quotes (and adding a space after the "-" in the sort command)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"
| stats count as total, count(eval('message.logType'="Outgoing Response")) as outgoingCount by log.request.url
| table log.request.url, total, outgoingCount
| sort - outgoingCount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 13:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520623#M146578</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-21T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520627#M146580</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt; but not work.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520627#M146580</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-21T14:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520629#M146582</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215670"&gt;@Nisha18789&lt;/a&gt; no, still not work in verbose mode...&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520629#M146582</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-21T14:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520634#M146585</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="my_index"
| stats count as total, count(eval('message.logType'="Outgoing Response")) as outgoingCount by "log.request.url"
| table "log.request.url", total, outgoingCount
| sort - outgoingCount&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520634#M146585</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-21T14:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520683#M146602</link>
      <description>&lt;P&gt;I tried, but still no luck...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hongbo_miao_0-1600716875811.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10918i1B61024CE6C2ABDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hongbo_miao_0-1600716875811.png" alt="hongbo_miao_0-1600716875811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520683#M146602</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-21T20:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520684#M146603</link>
      <description>&lt;P&gt;Thanks, I replied under &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt; still not work...&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 19:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520684#M146603</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-21T19:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520694#M146638</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="my_index"
| stats count as total, sum(eval(if('message.logType'="Outgoing Response",1,0))) as outgoingCount by "log.request.url"
| table "log.request.url", total, outgoingCount
| sort - outgoingCount&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Sep 2020 21:55:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520694#M146638</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-21T21:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520917#M146744</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt; still zero...&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520917#M146744</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-22T19:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520921#M146747</link>
      <description>&lt;P&gt;Rather than blurred screenshots, please can you share a raw event or two in a code block, anonymising the data appropriately because there seems to be something that we are all missing which might become clearer if we could see the raw data?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 19:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520921#M146747</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-22T19:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520940#M146751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/50019"&gt;@hongbo_miao&lt;/a&gt;&amp;nbsp;, can you try running below query once, and see you get any results ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="my_index"&lt;BR /&gt;| search message.logType="Outgoing Response"&lt;BR /&gt;| stats count as total, count(eval('message.logType'="Outgoing Response")) as outgoingCount by "log.request.url"&lt;BR /&gt;| table "log.request.url", total, outgoingCount&lt;BR /&gt;| sort - outgoingCount&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 21:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/520940#M146751</guid>
      <dc:creator>Nisha18789</dc:creator>
      <dc:date>2020-09-22T21:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521336#M146905</link>
      <description>&lt;P&gt;Got some help internally, and it finally works! Really appreciate! Here is the original copy:&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;First issue is that referencing json fields with . notation has some oddities.&lt;/P&gt;&lt;P&gt;The correct syntax would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count(eval('message.logType'="Outgoing Response")) as outgoingCount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats &amp;lt;statscmd&amp;gt;(&amp;lt;evalcmd&amp;gt;(&amp;lt;stuff))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;syntax can be hairy. Instead try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"
| eval outgoingCount = if(message.logType="Outgoing Response", 1, 0)
| stats count as total, count(outgoingCount) as outgoingCount by log.request.url
| table log.request.url, total, outgoingCount
| sort -outgoingCount&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;</description>
      <pubDate>Thu, 24 Sep 2020 17:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521336#M146905</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-24T17:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521337#M146906</link>
      <description>&lt;P&gt;This does not work for me too, but I got some help internally, I posted the answer!&lt;/P&gt;&lt;P&gt;Still thanks for help &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/215670"&gt;@Nisha18789&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 17:28:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521337#M146906</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-24T17:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Always got zero for count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521339#M146908</link>
      <description>&lt;P&gt;Oh I just got some help internally, I posted the working way.&lt;/P&gt;&lt;P&gt;Really really appreciate for the help &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; !&lt;/P&gt;&lt;P&gt;(BTW, I think you might be right about the raw data is not that formatted, although when I check they seem just json / object)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 17:36:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Always-got-zero-for-count/m-p/521339#M146908</guid>
      <dc:creator>hongbo_miao</dc:creator>
      <dc:date>2020-09-24T17:36:51Z</dc:date>
    </item>
  </channel>
</rss>

