<?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: Cannot get timechart to show correct results using by &amp;quot;ifName&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124070#M33524</link>
    <description>&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; is not your problem, &lt;CODE&gt;delta&lt;/CODE&gt; is. &lt;CODE&gt;delta&lt;/CODE&gt; doesn't know how to do a &lt;CODE&gt;delta field by otherfield&lt;/CODE&gt;, you need &lt;CODE&gt;streamstats&lt;/CODE&gt; for that. Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats window=1 global=f current=f last(ifHCInOctets) as last_in by ifName | eval in_change = ifHCInOctets - last_in | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Swap the &lt;CODE&gt;eval&lt;/CODE&gt; around in case I accidentally gave you negative changes.&lt;/P&gt;</description>
    <pubDate>Sun, 14 Sep 2014 20:58:39 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-09-14T20:58:39Z</dc:date>
    <item>
      <title>Cannot get timechart to show correct results using by "ifName"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124069#M33523</link>
      <description>&lt;P&gt;Using the below search works when I only specify a single ifName.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ohtwbgitxsg10 ifName=1/1 | sort _time | delta ifHCInOctets as in_change | delta ifHCOutOctets as out_change | where in_change&amp;gt;=0 | where out_change&amp;gt;=0 | eval inmbits=(in_change*8/1000/1000) | eval outmbits=(out_change*8/1000/1000) | timechart span=12m per_second(inmbits) as in_Mbits, per_second(outmbits) as out_Mbits
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if I want to display multiple ifNames on the chart by changing ifName=* then adding by ifName on the timechart the results are completely inaccurate.&lt;/P&gt;

&lt;P&gt;Am I doing something incorrectly or is there a better way of doing this?&lt;/P&gt;

&lt;P&gt;Thanks for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Sep 2014 20:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124069#M33523</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2014-09-14T20:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get timechart to show correct results using by "ifName"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124070#M33524</link>
      <description>&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; is not your problem, &lt;CODE&gt;delta&lt;/CODE&gt; is. &lt;CODE&gt;delta&lt;/CODE&gt; doesn't know how to do a &lt;CODE&gt;delta field by otherfield&lt;/CODE&gt;, you need &lt;CODE&gt;streamstats&lt;/CODE&gt; for that. Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats window=1 global=f current=f last(ifHCInOctets) as last_in by ifName | eval in_change = ifHCInOctets - last_in | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Swap the &lt;CODE&gt;eval&lt;/CODE&gt; around in case I accidentally gave you negative changes.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Sep 2014 20:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124070#M33524</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-09-14T20:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get timechart to show correct results using by "ifName"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124071#M33525</link>
      <description>&lt;P&gt;This ended up working out perfect thank you very much.&lt;/P&gt;

&lt;P&gt;If you don't mind please have a look at my final Search and let me know if you have a better/shorter way on making this work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ohtwbgitxsg10 ifName=1/1 OR ifName=2/1 OR ifName=3/1 OR ifName=4/1 | streamstats window=1 global=f current=f last(ifHCInOctets) as last_in by ifName | eval in_change = last_in - ifHCInOctets | where in_change&amp;gt;=0 | eval in_mbits=in_change*8/1000/1000 | streamstats window=1 global=f current=f last(ifHCOutOctets) as last_out by ifName | eval out_change = last_out - ifHCOutOctets | where out_change&amp;gt;=0 | eval out_mbits=out_change*8/1000/1000 |   timechart span=12m per_second(in_mbits), per_second(out_mbits) by ifName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Sep 2014 03:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124071#M33525</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2014-09-17T03:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get timechart to show correct results using by "ifName"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124072#M33526</link>
      <description>&lt;P&gt;You could shorten the search string itself by using &lt;CODE&gt;foreach&lt;/CODE&gt; around the &lt;CODE&gt;streamstats | eval | where | eval&lt;/CODE&gt;. Those two sets of search commands only differ by "in" and "out", the rest is duplicate. That's not going to influence the execution much though.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2014 07:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cannot-get-timechart-to-show-correct-results-using-by-quot/m-p/124072#M33526</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-09-17T07:49:50Z</dc:date>
    </item>
  </channel>
</rss>

