<?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: Split the total count in the rows per month and show the count under each months in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356821#M105559</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*...
| fields Name, events, Type 
| dedup events
| eval month=strftime(_time,"%b-%Y") 
| stats count(events) as "Events" by Name, Type month 
| eval temp=Name."###".Type 
| chart sum(Events) over temp by month
| rex field=temp "(?&amp;lt;Name&amp;gt;.+)###(?&amp;lt;Type&amp;gt;.+)"
| fields - temp | table Name Type *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Mar 2018 19:10:21 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-03-16T19:10:21Z</dc:date>
    <item>
      <title>Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356815#M105553</link>
      <description>&lt;P&gt;Hallo, &lt;/P&gt;

&lt;P&gt;I am trying to find the total number of different types of events per month(chronologically) and the sum of events per month , in short I am trying to achieve the below result without pivot --&amp;gt;&lt;/P&gt;

&lt;P&gt;Name     Type    Jan-17  Feb-17  Mar-17....... Dec 2017&lt;BR /&gt;
A              IN       10       20         30        ........     15&lt;BR /&gt;
                 SR      15       12         14       ........      26&lt;/P&gt;

&lt;P&gt;B              IN       10       11         16      .......        22&lt;BR /&gt;
                 SR       5        14         12      .........      20&lt;BR /&gt;
                           30(Total) .........72(total).........83(total)&lt;/P&gt;

&lt;P&gt;index=*...&lt;BR /&gt;
| fields Name, events, Type &lt;BR /&gt;
| dedup events&lt;BR /&gt;
| eval month=strftime(_time,"%b-%Y") &lt;BR /&gt;
| stats count(events) as "Events" by Name, Type&lt;/P&gt;

&lt;P&gt;I am able to formulate the results only until a point.&lt;/P&gt;

&lt;P&gt;Name     Type    Events&lt;BR /&gt;
A              IN        45&lt;BR /&gt;
A              SR        40&lt;BR /&gt;
B              IN        40&lt;BR /&gt;
B              SR       26&lt;/P&gt;

&lt;P&gt;Events is the total sum of events per month, I want to find out a way to split it up somehow to achieve the desired results. Is it possible?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:02:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356815#M105553</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-16T13:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356816#M105554</link>
      <description>&lt;P&gt;Have you tried &lt;CODE&gt;... | stats count(events) as "Events" by Name, Type, month&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356816#M105554</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-16T13:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356817#M105555</link>
      <description>&lt;P&gt;@richgalloway - Yes ofcourse I had tried that, It gave me the months and events as row items only .&lt;/P&gt;

&lt;P&gt;Name Type Events Months&lt;BR /&gt;
A          IN         45     Apr&lt;BR /&gt;
A          SR         40     Apr&lt;BR /&gt;
B          IN          40    Apr&lt;BR /&gt;
B          SR         26    Apr&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356817#M105555</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-16T13:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356818#M105556</link>
      <description>&lt;P&gt;How about &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart count(events) as "Events" over date_month by Name, Type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 13:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356818#M105556</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-16T13:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356819#M105557</link>
      <description>&lt;P&gt;@tiagofbmm - I dont think we can use two fields after BY clause when using chart.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 17:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356819#M105557</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-16T17:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356820#M105558</link>
      <description>&lt;P&gt;@njohnson7, if &lt;CODE&gt;over clause is not used&lt;/CODE&gt;, then two fields can be used with &lt;CODE&gt;chart&lt;/CODE&gt; in &lt;CODE&gt;by clause&lt;/CODE&gt; and first one in the by clause is considered as over. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 19:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356820#M105558</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-16T19:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356821#M105559</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*...
| fields Name, events, Type 
| dedup events
| eval month=strftime(_time,"%b-%Y") 
| stats count(events) as "Events" by Name, Type month 
| eval temp=Name."###".Type 
| chart sum(Events) over temp by month
| rex field=temp "(?&amp;lt;Name&amp;gt;.+)###(?&amp;lt;Type&amp;gt;.+)"
| fields - temp | table Name Type *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 19:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356821#M105559</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-16T19:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356822#M105560</link>
      <description>&lt;P&gt;@njohnson7, how about the following?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*...
| fields Name, events, Type 
| dedup events
| eval month=strftime(_time,"%b-%Y") 
| eval key=Name."-". Type
| chart count(events) as "Events" over key by month
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Mar 2018 19:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356822#M105560</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-16T19:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356823#M105561</link>
      <description>&lt;P&gt;@niketnilay - Sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But @tiagofbmm mentioned about using two fields after a by clause even with an over close in the query.  I was just referring to that. &lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 05:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356823#M105561</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-17T05:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356824#M105562</link>
      <description>&lt;P&gt;@somesoni2 , thanks a lot .  almost there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;When the Months were plotted as Column Headers, it was not getting sorted. &lt;BR /&gt;
So I had to use | eval month=strftime(_time,"%Y-%m (%B-%Y)") to get it sorted.&lt;/P&gt;

&lt;P&gt;Now after plotting the table, the final layout looks like this --&amp;gt;&lt;/P&gt;

&lt;P&gt;Name   Type 2017-02 (February-2017) 2017-03 (March-2017)    2017-04 (April-2017)&lt;BR /&gt;
Name1   IN  27  15  3&lt;BR /&gt;
Name 1   SR    1    6   3&lt;BR /&gt;
Name1    P      21  41  39&lt;/P&gt;

&lt;P&gt;Name2   IN  27  15  3&lt;BR /&gt;
Name 2   SR    1    6   3&lt;BR /&gt;
Name2   P      21   41  39&lt;/P&gt;

&lt;P&gt;1) If you see the values in the Name column remains the same for a group of data contained in the different months(column headers), is there anyway to list that value once for a group of data .. read about mvcombine but I was not able to figure out how to use it?&lt;/P&gt;

&lt;P&gt;2) If we use eval month=strftime(_time,"%b-%Y") --&amp;gt; is there anyway to sort the months coming as column headers, because this time format is pleasing visually.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 07:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356824#M105562</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-20T07:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356825#M105563</link>
      <description>&lt;P&gt;Thanks @niketnilay , I didnt see this comment as it was not showing unless expanded, obviously this comment was the first steps to what I wanted to achieve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Hope there is someway to go about the two questions I asked in my last comment. &lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356825#M105563</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2018-03-21T04:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356826#M105564</link>
      <description>&lt;P&gt;Please explain line 5&lt;BR /&gt;
 index=*...&lt;BR /&gt;
 | fields Name, events, Type &lt;BR /&gt;
 | dedup events&lt;BR /&gt;
 | eval month=strftime(_time,"%b-%Y") &lt;BR /&gt;
 | stats count(events) as "Events" by Name, Type month &lt;BR /&gt;
 | eval temp=Name."###".Type &lt;BR /&gt;
 | chart sum(Events) over temp by month&lt;BR /&gt;
 | rex field=temp "(?.+)###(?.+)"&lt;BR /&gt;
 | fields - temp | table Name Type *&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 19:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356826#M105564</guid>
      <dc:creator>pandasplunk84</dc:creator>
      <dc:date>2018-10-17T19:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Split the total count in the rows per month and show the count under each months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356827#M105565</link>
      <description>&lt;P&gt;@pandasplunk84 "eval temp=Name."###".Type " this is concatenating the fields Name and Type with ### in the middle and forming a new field called temp. &lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2019 09:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Split-the-total-count-in-the-rows-per-month-and-show-the-count/m-p/356827#M105565</guid>
      <dc:creator>njohnson7</dc:creator>
      <dc:date>2019-03-09T09:25:25Z</dc:date>
    </item>
  </channel>
</rss>

