<?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 Timechart - Combining by columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33413#M7090</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Hoping you may be able to point me in the right direction.  I have a log like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TimeStamp="2011-12-13 09:00:01" NEID="MAS4_EDW" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MAS4_RTDAS" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MAS4_WBI" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC7" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC7_IC" FileCount="4"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC_IC" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC1" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MSC10" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC11" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MSC12" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC13" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MSC14" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC15" FileCount="1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The FileCount gets inputed into this log at say every 30 minutes.... &lt;/P&gt;

&lt;P&gt;Now, I can easily graph the trends of the file counts over time by NEID with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="&amp;lt;FILE&amp;gt;" | timechart span=30m limit=0 sum(FileCount) by NEID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BUT, what I would like to do is group all the MSC*, MSS* and MAS* fields... so that instead of getting a table/graph with a line for each NEID, I get one for the SUM(FileCount) of all MSS*, etc for MAS* and MSS*&lt;/P&gt;

&lt;P&gt;I've tried quite a few eval type queries with no luck at this stage.  Does anyone have any pointers please?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 10:13:06 GMT</pubDate>
    <dc:creator>sampipe</dc:creator>
    <dc:date>2020-09-28T10:13:06Z</dc:date>
    <item>
      <title>Timechart - Combining by columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33413#M7090</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Hoping you may be able to point me in the right direction.  I have a log like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TimeStamp="2011-12-13 09:00:01" NEID="MAS4_EDW" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MAS4_RTDAS" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MAS4_WBI" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC7" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC7_IC" FileCount="4"
TimeStamp="2011-12-13 09:00:01" NEID="MMSC_IC" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC1" FileCount="0"
TimeStamp="2011-12-13 09:00:01" NEID="MSC10" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC11" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MSC12" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC13" FileCount="2"
TimeStamp="2011-12-13 09:00:01" NEID="MSC14" FileCount="1"
TimeStamp="2011-12-13 09:00:01" NEID="MSC15" FileCount="1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The FileCount gets inputed into this log at say every 30 minutes.... &lt;/P&gt;

&lt;P&gt;Now, I can easily graph the trends of the file counts over time by NEID with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="&amp;lt;FILE&amp;gt;" | timechart span=30m limit=0 sum(FileCount) by NEID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BUT, what I would like to do is group all the MSC*, MSS* and MAS* fields... so that instead of getting a table/graph with a line for each NEID, I get one for the SUM(FileCount) of all MSS*, etc for MAS* and MSS*&lt;/P&gt;

&lt;P&gt;I've tried quite a few eval type queries with no luck at this stage.  Does anyone have any pointers please?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33413#M7090</guid>
      <dc:creator>sampipe</dc:creator>
      <dc:date>2020-09-28T10:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Combining by columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33414#M7091</link>
      <description>&lt;P&gt;If I understand you correctly, you wish to group on &lt;CODE&gt;MSC*&lt;/CODE&gt;, &lt;CODE&gt;MAS*&lt;/CODE&gt; etc - regardless of the number that follows the first three characters for the values of NEID.&lt;/P&gt;

&lt;P&gt;In that case you can use;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="&amp;lt;FILE&amp;gt;" | eval ZZZ=substr(NEID,1,3) | timechart span=30m limit=0 sum(FileCount) by ZZZ
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2011 21:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33414#M7091</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-12T21:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Combining by columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33415#M7092</link>
      <description>&lt;P&gt;Thanks Kristian... That's excellent... That has worked perfectly.. I'm going to slightly complicate the issue a bit more and see if you can help &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Lets say I just want to group the MSS* ones, but leave the rest the same.... I'm guessing I'll have to get an eval if() going in there somehow... &lt;/P&gt;

&lt;P&gt;So, for the above set of logs I would like the columns to be (just the MSS* ones summed up.. teh rest left as they are):&lt;/P&gt;

&lt;P&gt;MAS4_EDW, MAS4_RTDAS, MAS4_WBI, MMSC, MMSC7_IC, MMSC_IC, MSC&lt;/P&gt;

&lt;P&gt;Really appreciate the help.. &lt;/P&gt;

&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33415#M7092</guid>
      <dc:creator>sampipe</dc:creator>
      <dc:date>2020-09-28T10:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Combining by columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33416#M7093</link>
      <description>&lt;P&gt;I think I've been able to adapt this to meet my requirements&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="&amp;lt;FILE&amp;gt;" | eval ZZZ=if(substr(NEID,1,3)=="MSS",substr(NEID,1,3),NEID) | timechart span=30m limit=0 sum(FileCount) by ZZZ
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks Kristian for the point in the right direction.&lt;/P&gt;

&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2011 23:14:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Combining-by-columns/m-p/33416#M7093</guid>
      <dc:creator>sampipe</dc:creator>
      <dc:date>2011-12-12T23:14:24Z</dc:date>
    </item>
  </channel>
</rss>

