<?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: can we get 4 different fields count per hour in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481579#M134972</link>
    <description>&lt;P&gt;If that is the case, you will need to show us a sample log.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2020 18:45:05 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-01-10T18:45:05Z</dc:date>
    <item>
      <title>can we get 4 different fields count per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481576#M134969</link>
      <description>&lt;P&gt;I am trying to get count of four fields [  company_name companyID CustomerId Provider] by each hour &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=IndexName 
| bin span=1h _time 
| stats count by company_name companyID CustomerId Provider _time 
| sort 0 _time 
| eval results= 'companyName'+" : "+'companyID'+" : "+'CustomerId'+" : "+'Provider'
| eval time=strftime(_time,"%m-%d-%Y--%H-%M-%S") 
| table results time count 
| xyseries results time count 
| rex field=results "(?&amp;lt;companyName&amp;gt;.+):(?&amp;lt;companyID&amp;gt;.+):(?&amp;lt;CustomerId&amp;gt;.+):(?&amp;lt;Provider&amp;gt;.+)"
| table  company_name companyID CustomerId Provider * 
| addcoltotals labelfield=company_name label="Total_count"
| fields - count results
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to get results like i need, But i am pretty sure this search isn't the good way to do it. &lt;/P&gt;

&lt;P&gt;Expected results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;company_name companyID CustomerId   Provider 12:00 01:00 02:00 03:00 04:00 ---
  Apple        1234       vgs31982   pro-1     10    20    30    40   10 
  google       567        kjf733     pro-2     11    11    33    83    20
 Total_count                                   21    31    63    123   30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;can some help me on this.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 22:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481576#M134969</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2020-01-09T22:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: can we get 4 different fields count per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481577#M134970</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=IndexName 
| eval results= 'companyName'+" : "+'companyID'+" : "+'CustomerId'+" : "+'Provider' 
| timechart span=1h count by results
| eval time=strftime(_time,"%H:%M") 
| table results time count 
| xyseries results time count 
| addcoltotals labelfield=results label="Total_count"
| rex field=results "(?&amp;lt;companyName&amp;gt;.+):(?&amp;lt;companyID&amp;gt;.+):(?&amp;lt;CustomerId&amp;gt;.+):(?&amp;lt;Provider&amp;gt;.+)" 
| table company_name companyID CustomerId Provider *
| fields - count results
| fillnull company_name value="Total_count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 13:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481577#M134970</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-10T13:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: can we get 4 different fields count per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481578#M134971</link>
      <description>&lt;P&gt;Actually my query is working fine, I am just looking for a different approach without combining all fields. &lt;BR /&gt;
I can't accept this answer, I don't see any difference from what my question is..&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 16:10:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481578#M134971</guid>
      <dc:creator>snallam123</dc:creator>
      <dc:date>2020-01-10T16:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: can we get 4 different fields count per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481579#M134972</link>
      <description>&lt;P&gt;If that is the case, you will need to show us a sample log.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 18:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/can-we-get-4-different-fields-count-per-hour/m-p/481579#M134972</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-10T18:45:05Z</dc:date>
    </item>
  </channel>
</rss>

