<?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: Stats sum command experiencing strange behavior after 7.2.0 upgrade in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391112#M113855</link>
    <description>&lt;P&gt;Do post a sample event.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Nov 2018 17:25:51 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2018-11-12T17:25:51Z</dc:date>
    <item>
      <title>Stats sum command experiencing strange behavior after 7.2.0 upgrade</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391111#M113854</link>
      <description>&lt;P&gt;Hi Folks;&lt;/P&gt;

&lt;P&gt;So getting a very bizaare issue here after our upgrade to 7.2&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="app_rocket_dxs" sourcetype="fluentd_json" source="vbs-dxs-int*" 
| where message like "%Summary%" 
| eval temp=split(substr(message,64,250),":")  
| eval DomainName=mvindex(temp,1)  
| eval StartTime=mvindex(temp,3) 
| eval EndTime=mvindex(temp,5) 
| eval TopicName=mvindex(temp,7) 
| eval MsgCount=mvindex(temp,9) 
| convert num(MsgCount) as MsgCounts |convert timeformat="%Y-%m-%d" ctime(_time) AS date
| table StartTime,EndTime,MsgCounts,DomainName,TopicName,date
| stats sum(MsgCounts) as PublishedCount by date,TopicName
| sort date desc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the way the data looks as a table&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6110iDB6F3A210B695F95/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However after applying the stats command the 'PublishedCount' is blank:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6111iA60C23ED77100EE8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Sample Event (scrubbed)&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"docker":{"container_id":"8203837773d4f65d9a3382d381c97f64af01209f865463239e7d59e6ed2972ec"},"kubernetes":{"container_name":"coverageemclntbenplan","namespace_name":"vbs-dxs-int","pod_name":"covplan-1-m9g6x","pod_id":"a8004109-e37d-11e8-b28e-fa163e193d33","labels":{"app":"covenplan","appname":"Rocket","deployment":"covernplan-1","deploymentconfig":"coveeplan"},"host":"cilver.com","master_url":"https://kubernetes.default.svc.cluster.local","namespace_id":"23eecb03-7947-11e8-9035-fa163ee5bb62"},"message":"11-12 16:37 oraclepool.oraclekafka INFO     Publisher Summary - Domain:coverage:Start_Bound:2018-11-12-11.33.26.421532 :End_Bound:2018-11-12-11.35.26.532198 :Topic Name:ibis.cif_em_o.em_clnt_ben_plan:count:0\n","level":"info","pipeline_metadata":{"collector":{"ipaddr4":"100.00.00.00","ipaddr6":"fe80::0000:0000:0000:a728","inputname":"fluent-plugin-systemd","name":"fluentd","received_at":"2018-11-12T16:37:21.820821+00:00","version":"0.12.43 1.6.0"}},"@timestamp":"2018-11-12T16:37:21.767889+00:00","viaq_index_name":"project.vbs-dxs-int.23eecb03-7947-11e8-9035-fa163ee5bb62.2018.11.12","viaq_msg_id":"NzM0OWEzZGEtMmJiNy00MDQ3LWI4ZjAtZTdkMGU1MzY0MzZj","kubernetes_node":"cilver.com"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 17:02:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391111#M113854</guid>
      <dc:creator>paimonsoror</dc:creator>
      <dc:date>2018-11-12T17:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stats sum command experiencing strange behavior after 7.2.0 upgrade</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391112#M113855</link>
      <description>&lt;P&gt;Do post a sample event.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 17:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391112#M113855</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-12T17:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Stats sum command experiencing strange behavior after 7.2.0 upgrade</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391113#M113856</link>
      <description>&lt;P&gt;Updated with sample!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 18:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391113#M113856</guid>
      <dc:creator>paimonsoror</dc:creator>
      <dc:date>2018-11-12T18:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Stats sum command experiencing strange behavior after 7.2.0 upgrade</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391114#M113857</link>
      <description>&lt;P&gt;Look at your &lt;CODE&gt;message&lt;/CODE&gt; string in detail - it has a tailing line breaker &lt;CODE&gt;\n&lt;/CODE&gt;. Your approach of splitting at colons will include the line breaker in your field value, breaking the sum. Sanitize your value using &lt;CODE&gt;trim()&lt;/CODE&gt; or &lt;CODE&gt;replace()&lt;/CODE&gt;, or use rex instead of splitting:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=message ":count:(?&amp;lt;MsgCounts&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Side note, add the word &lt;CODE&gt;Summary&lt;/CODE&gt; to your initial search to reduce the number of events loaded off disk (&lt;CODE&gt;scanCount&lt;/CODE&gt; in the job inspector).&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 18:15:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391114#M113857</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-12T18:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Stats sum command experiencing strange behavior after 7.2.0 upgrade</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391115#M113858</link>
      <description>&lt;P&gt;you sir, are a scholar.  thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 19:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-sum-command-experiencing-strange-behavior-after-7-2-0/m-p/391115#M113858</guid>
      <dc:creator>paimonsoror</dc:creator>
      <dc:date>2018-11-12T19:08:20Z</dc:date>
    </item>
  </channel>
</rss>

