<?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 Need to add the numeric value after split in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210045#M61431</link>
    <description>&lt;P&gt;HI  All,&lt;/P&gt;

&lt;P&gt;I have a log like below,there are under Message field in the logs :&lt;BR /&gt;
ApplicationName date. total: 2.This is the count: 35&lt;BR /&gt;
ApplicationName date. total: 3.This is the count: 39&lt;/P&gt;

&lt;P&gt;I have used below query and want the sum of all the numeric values :&lt;BR /&gt;
index=xyz sourcetype=abc|eval field=split(Message,":")|eval num=mvindex(field,2)|eval field2=split(mvindex(field,1),".")|eval num1=mvindex(field2,0)|table num num1&lt;/P&gt;

&lt;P&gt;which is giving below result  as expected:&lt;BR /&gt;
num    num1&lt;BR /&gt;
35         2&lt;BR /&gt;
39          3&lt;/P&gt;

&lt;P&gt;what i want is Sum :&lt;BR /&gt;
                      num    num1&lt;BR /&gt;
                       35         2&lt;BR /&gt;
                       39          3&lt;BR /&gt;
&lt;STRONG&gt;Total&lt;/STRONG&gt;       74          5&lt;BR /&gt;
I have tried : query|&lt;STRONG&gt;addcolstotal&lt;/STRONG&gt; num num1   and &lt;STRONG&gt;stats sum&lt;/STRONG&gt;(num) by host  etc...but they are just not working .&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2016 08:44:48 GMT</pubDate>
    <dc:creator>AdixitSplunk</dc:creator>
    <dc:date>2016-12-29T08:44:48Z</dc:date>
    <item>
      <title>Need to add the numeric value after split</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210045#M61431</link>
      <description>&lt;P&gt;HI  All,&lt;/P&gt;

&lt;P&gt;I have a log like below,there are under Message field in the logs :&lt;BR /&gt;
ApplicationName date. total: 2.This is the count: 35&lt;BR /&gt;
ApplicationName date. total: 3.This is the count: 39&lt;/P&gt;

&lt;P&gt;I have used below query and want the sum of all the numeric values :&lt;BR /&gt;
index=xyz sourcetype=abc|eval field=split(Message,":")|eval num=mvindex(field,2)|eval field2=split(mvindex(field,1),".")|eval num1=mvindex(field2,0)|table num num1&lt;/P&gt;

&lt;P&gt;which is giving below result  as expected:&lt;BR /&gt;
num    num1&lt;BR /&gt;
35         2&lt;BR /&gt;
39          3&lt;/P&gt;

&lt;P&gt;what i want is Sum :&lt;BR /&gt;
                      num    num1&lt;BR /&gt;
                       35         2&lt;BR /&gt;
                       39          3&lt;BR /&gt;
&lt;STRONG&gt;Total&lt;/STRONG&gt;       74          5&lt;BR /&gt;
I have tried : query|&lt;STRONG&gt;addcolstotal&lt;/STRONG&gt; num num1   and &lt;STRONG&gt;stats sum&lt;/STRONG&gt;(num) by host  etc...but they are just not working .&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 08:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210045#M61431</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2016-12-29T08:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need to add the numeric value after split</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210046#M61432</link>
      <description>&lt;P&gt;Try adding tonumber. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=abc|eval field=split(Message,":")|eval num=tonumber(mvindex(field,2))|eval field2=split(mvindex(field,1),".")|eval num1=tonumber(mvindex(field2,0))|table num num1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2016 13:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210046#M61432</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-12-29T13:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need to add the numeric value after split</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210047#M61433</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xyz sourcetype=abc 
| rex field=Message "total:\s*(?&amp;lt;num1&amp;gt;\d+).+count:\s*(?&amp;lt;num2&amp;gt;\d+)"
| table num1 num2
| addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2016 14:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210047#M61433</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-29T14:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need to add the numeric value after split</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210048#M61434</link>
      <description>&lt;P&gt;Thank you ..... It really helped&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 06:52:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-add-the-numeric-value-after-split/m-p/210048#M61434</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2016-12-30T06:52:07Z</dc:date>
    </item>
  </channel>
</rss>

