<?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: Help with the logic to make this count my fields correctly in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-the-logic-to-make-this-count-my-fields-correctly/m-p/299493#M56641</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;If you have field OS only showing the OS names and not the count.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field OS and count
| makemv OS delim=","  | mvexpand OS | stats sum(count) as count by OS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If &lt;CODE&gt;Windows = 5&lt;/CODE&gt; is the actual full value for field OS, try this (extracting OS names and count)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field OS with values like Windows = 5
| rex field=OS "(?&amp;lt;OS1&amp;gt;\S+)\s*\=(?&amp;lt;count&amp;gt;\d+)"
 | makemv OS1 delim=","  | mvexpand OS1 | stats sum(count) as count by OS1 | rename OS1 as OS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Aug 2017 03:58:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-08-24T03:58:01Z</dc:date>
    <item>
      <title>Help with the logic to make this count my fields correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-the-logic-to-make-this-count-my-fields-correctly/m-p/299492#M56640</link>
      <description>&lt;P&gt;Hi, I have the following field called OS with 6 different values and count for each value:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Windows = 5
Mac = 4
Linux = 5
Mac, Windows = 10
Mac, Windows, Linux = 12
Mac, Linux = 11
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem stand on that the real total of Windows values would be &lt;STRONG&gt;Windows,Windows+Mac,Windows,Linux&lt;/STRONG&gt; (5+10+12)&lt;/P&gt;

&lt;P&gt;So I would like to separate Mac,Windows into Windows and Mac values and add them to the Windows and Mac value.&lt;/P&gt;

&lt;P&gt;At the end I would like to have something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Windows=27
Mac=26
Linux=16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My idea is to rename them twice but it doesn't really work out for me. Any ideas or solutions are welcome.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 01:52:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-the-logic-to-make-this-count-my-fields-correctly/m-p/299492#M56640</guid>
      <dc:creator>JRamirezEnosys</dc:creator>
      <dc:date>2017-08-24T01:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with the logic to make this count my fields correctly</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-with-the-logic-to-make-this-count-my-fields-correctly/m-p/299493#M56641</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;If you have field OS only showing the OS names and not the count.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field OS and count
| makemv OS delim=","  | mvexpand OS | stats sum(count) as count by OS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If &lt;CODE&gt;Windows = 5&lt;/CODE&gt; is the actual full value for field OS, try this (extracting OS names and count)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field OS with values like Windows = 5
| rex field=OS "(?&amp;lt;OS1&amp;gt;\S+)\s*\=(?&amp;lt;count&amp;gt;\d+)"
 | makemv OS1 delim=","  | mvexpand OS1 | stats sum(count) as count by OS1 | rename OS1 as OS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Aug 2017 03:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-with-the-logic-to-make-this-count-my-fields-correctly/m-p/299493#M56641</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-24T03:58:01Z</dc:date>
    </item>
  </channel>
</rss>

