<?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: Value doubles when including additional by parameter in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247323#M73776</link>
    <description>&lt;P&gt;You may already have either &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; or &lt;CODE&gt;KV_MODE&lt;/CODE&gt; set to JSON, so yeah - your &lt;CODE&gt;spath&lt;/CODE&gt; would add a second copy of the fields.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2016 21:25:09 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-03-14T21:25:09Z</dc:date>
    <item>
      <title>Value doubles when including additional by parameter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247320#M73773</link>
      <description>&lt;P&gt;I have a rather odd issue occurring, if I include an additional field in my by clause (which I do need) the values I get end up being doubled. If I don't have the additional field then I get the correct values.&lt;BR /&gt;
For the given query;&lt;BR /&gt;
    &lt;CODE&gt;sourcetype=metrics source=event-publisher type="m" | spath | search name="publisher.send" | streamstats window=2 current=t global=f  earliest(val.count) as begin, latest(val.count) as end by name | eval delta=if (end-begin &amp;lt; 0,end,end-begin) | bin span=1h _time | chart sum(delta) by _time,name&lt;/CODE&gt;&lt;BR /&gt;
The delta and everything works fine, the issue is &lt;CODE&gt;chart sum(delta) by _time,name&lt;/CODE&gt; namely the &lt;CODE&gt;,name&lt;/CODE&gt; portion. if I exclude that and just have &lt;CODE&gt;chart sum(delta) by _time&lt;/CODE&gt; I get the correct values. However if I add &lt;CODE&gt;,name&lt;/CODE&gt; it doubles the values. &lt;BR /&gt;
The same thing happens when using &lt;CODE&gt;timechart&lt;/CODE&gt;. filtering on the &lt;CODE&gt;name&lt;/CODE&gt; is for troubleshooting purposes. &lt;/P&gt;

&lt;P&gt;For example, if for a one hour period the delta is (from start of hour to end) is a total of 14, if I don't include &lt;CODE&gt;name&lt;/CODE&gt; in the &lt;CODE&gt;by&lt;/CODE&gt; for &lt;CODE&gt;chart&lt;/CODE&gt; then I get a result of 14 (as expected), however if I do include &lt;CODE&gt;name&lt;/CODE&gt; in the &lt;CODE&gt;by&lt;/CODE&gt; clause I get 28.&lt;BR /&gt;&lt;BR /&gt;
I'm not sure if something odd is happening between using the &lt;CODE&gt;by name&lt;/CODE&gt; and the &lt;CODE&gt;streamstats&lt;/CODE&gt; ? &lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 14:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247320#M73773</guid>
      <dc:creator>doswellc</dc:creator>
      <dc:date>2016-03-14T14:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Value doubles when including additional by parameter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247321#M73774</link>
      <description>&lt;P&gt;The behaviour could be  indicative of a multi-value &lt;CODE&gt;name&lt;/CODE&gt; field. To check, run this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=metrics source=event-publisher type="m" | spath | eval mv_count = mvcount(name)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and check the values of &lt;CODE&gt;mv_count&lt;/CODE&gt; in the field list on the left.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 17:57:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247321#M73774</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-14T17:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Value doubles when including additional by parameter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247322#M73775</link>
      <description>&lt;P&gt;Yeah it reports 2. As far as I can tell the piping through spath is causing the duplicates. If I specify a specific value to extract with spath it's fine, but just the general &lt;CODE&gt;| spath |&lt;/CODE&gt; causes the multiple values. I can actually just do &lt;BR /&gt;
&lt;CODE&gt;sourcetype=metrics source=event-publisher type="m" |  chart sum(val.count)  by _time span=1h&lt;/CODE&gt; and get values without issue. I guess Splunk is auto extracting the json already and didn't need &lt;CODE&gt;spath&lt;/CODE&gt; pipe at all. &lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 19:35:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247322#M73775</guid>
      <dc:creator>doswellc</dc:creator>
      <dc:date>2016-03-14T19:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Value doubles when including additional by parameter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247323#M73776</link>
      <description>&lt;P&gt;You may already have either &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; or &lt;CODE&gt;KV_MODE&lt;/CODE&gt; set to JSON, so yeah - your &lt;CODE&gt;spath&lt;/CODE&gt; would add a second copy of the fields.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 21:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Value-doubles-when-including-additional-by-parameter/m-p/247323#M73776</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-14T21:25:09Z</dc:date>
    </item>
  </channel>
</rss>

