<?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 Show count by a field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/563949#M196445</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have a requirement to in which a table is ingested to Splunk. And the table has a field named Time showing timestamp as "YYYY-MM-DD HH:MM:SS:milisec". Data ingestion is happening without any issues. When I tried to show the count of events in a particular day&lt;/P&gt;&lt;P&gt;1. With stats command, the count is is matching with source, but there are times when there is no event happens in source system and that day count is not showing as 0 in Splunk, its just ignored.&lt;/P&gt;&lt;P&gt;2. With time command, Splunk takes the ingested timestamp of the event and not the timestamp in the event, and the count is not matching. Whereas, here when there is no data gets ingested, the count is showing as 0.&lt;/P&gt;&lt;P&gt;Please help me with this issue, where the count should be calculated with the field Time and in case if there is no event for a day, that should get displayed as 0. I'm trying to show the data in a bar chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated. Thanks.&lt;/P&gt;&lt;P&gt;Regards, Karthikeyan.SV&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 12:34:57 GMT</pubDate>
    <dc:creator>Karthikeyan</dc:creator>
    <dc:date>2021-08-19T12:34:57Z</dc:date>
    <item>
      <title>Show count by a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/563949#M196445</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have a requirement to in which a table is ingested to Splunk. And the table has a field named Time showing timestamp as "YYYY-MM-DD HH:MM:SS:milisec". Data ingestion is happening without any issues. When I tried to show the count of events in a particular day&lt;/P&gt;&lt;P&gt;1. With stats command, the count is is matching with source, but there are times when there is no event happens in source system and that day count is not showing as 0 in Splunk, its just ignored.&lt;/P&gt;&lt;P&gt;2. With time command, Splunk takes the ingested timestamp of the event and not the timestamp in the event, and the count is not matching. Whereas, here when there is no data gets ingested, the count is showing as 0.&lt;/P&gt;&lt;P&gt;Please help me with this issue, where the count should be calculated with the field Time and in case if there is no event for a day, that should get displayed as 0. I'm trying to show the data in a bar chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated. Thanks.&lt;/P&gt;&lt;P&gt;Regards, Karthikeyan.SV&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 12:34:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/563949#M196445</guid>
      <dc:creator>Karthikeyan</dc:creator>
      <dc:date>2021-08-19T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Show count by a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564003#M196461</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command counts events.&amp;nbsp; If data from a certain source is absent then it is not counted.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; command also counts events, but will automatically (unless told otherwise) fill in zeroes for time periods with no data.&amp;nbsp; Again, if a source is completely absent then it cannot be counted.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; command requires the _time field for it to work.&amp;nbsp; You can, however, set _time to any other field you have.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | eval _time=Time
| timechart count by source&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 23:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564003#M196461</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-08-19T23:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Show count by a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564092#M196490</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We use below search query to find the count&lt;/P&gt;&lt;P&gt;index="index" sourcetype="source_events"&lt;BR /&gt;| eval time=strptime(TIME,"%Y-%m-%d %H:%M:%S.%Q")&lt;BR /&gt;| eval date = strftime(time,"%Y-%m-%d")&lt;BR /&gt;|timechart span=1d count(date)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I tried with the provided search command, didn't get the output.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 13:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564092#M196490</guid>
      <dc:creator>Karthikeyan</dc:creator>
      <dc:date>2021-08-20T13:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Show count by a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564093#M196491</link>
      <description>&lt;P&gt;Since this is ingested as a table, no new source are generated and hence we could see not count values. Apart from time field, there are other unique fields such as EXECUTION_HASH, EXECUTION_ID, with which I tried to do a count, but couldn't get desired result.&lt;BR /&gt;&lt;BR /&gt;Search query:&lt;BR /&gt;| eval _time=TIME&lt;BR /&gt;| timechart count by EXECUTION_ID&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2021 13:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Show-count-by-a-field-value/m-p/564093#M196491</guid>
      <dc:creator>Karthikeyan</dc:creator>
      <dc:date>2021-08-20T13:27:31Z</dc:date>
    </item>
  </channel>
</rss>

