<?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: Get Percentage of Network bandwidth in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181904#M186908</link>
    <description>&lt;P&gt;Thanks! That's been corrected.&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2015 17:28:09 GMT</pubDate>
    <dc:creator>tysonjhayes</dc:creator>
    <dc:date>2015-05-06T17:28:09Z</dc:date>
    <item>
      <title>Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181900#M186904</link>
      <description>&lt;P&gt;I'm looking to define a query that allows me to query the Network Interface for all my machines and create a percentage utilization for each interface. I'm having a bit of trouble with it though.&lt;/P&gt;

&lt;P&gt;What I'm ultimately looking for is to take the TotalBytes being used on my Network Interface and divide by my current bandwidth. Basically: ((totalBytes*8)/CurrentBandwidth) * 100&lt;/P&gt;

&lt;P&gt;I've come up with the following query but CurrentBandwidth doesn't come back with anything and I get an error that I'm interpreting to me an I'm dividing by zero.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index host=host object="Network Interface" counter="Bytes Total/sec"
    | bucket _time span=1m
    | stats avg(Value) as bytesByHost by _time,host
    | stats sum(bytesByHost) as totalBytes by _time
    | append [search index=index host=host object="Network Interface" counter="Current Bandwidth" instance!="isatap.*"
        | bucket _time span=1m 
        | stats avg(Value) as connsByHost by _time | stats sum(connsByHost) as CurrentBandwidth by _time ]
    | stats exact(((totalBytes*8)/CurrentBandwidth) * 100)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Error: Error in 'stats' command: The argument 'exact(((totalBytes*8)/CurrentBandwidth) * 100)' is invalid.&lt;/P&gt;

&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 16:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181900#M186904</guid>
      <dc:creator>tysonjhayes</dc:creator>
      <dc:date>2015-05-06T16:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181901#M186905</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Exact(X)&lt;/STRONG&gt; is a function for Eval and Where&lt;/P&gt;

&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=index host=host object="Network Interface" counter="Bytes Total/sec"
     | bucket _time span=1m
     | stats avg(Value) as bytesByHost by _time,host
     | stats sum(bytesByHost) as totalBytes by _time
     | append [search index=index host=host object="Network Interface" counter="Current Bandwidth" instance!="isatap.*"
         | bucket _time span=1m 
         | stats avg(Value) as connsByHost by _time | stats sum(connsByHost) as CurrentBandwidth by _time ]
     | eval total= exact(totalBytes*8/CurrentBandwidth * 100)
 | stats  values(total)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2015 17:18:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181901#M186905</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-06T17:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181902#M186906</link>
      <description>&lt;P&gt;"exact" is not a stats function:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Stats"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Stats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 17:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181902#M186906</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-06T17:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181903#M186907</link>
      <description>&lt;P&gt;Tried your function and while I'm not getting the error anymore (thanks!) I'm not getting any data for total.  It still looks like CurrentBandwidth is null.&lt;/P&gt;

&lt;P&gt;When I run the appended search by itself I'm getting results but put it in the append I'm getting nothing...&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 17:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181903#M186907</guid>
      <dc:creator>tysonjhayes</dc:creator>
      <dc:date>2015-05-06T17:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181904#M186908</link>
      <description>&lt;P&gt;Thanks! That's been corrected.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 17:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181904#M186908</guid>
      <dc:creator>tysonjhayes</dc:creator>
      <dc:date>2015-05-06T17:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181905#M186909</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=index host=host object="Network Interface" counter="Bytes Total/sec"
          | bucket _time span=1m
          | stats avg(Value) as bytesByHost by _time,host
          | stats sum(bytesByHost) as totalBytes by _time
          | append [search index=index host=host object="Network Interface" counter="Current Bandwidth" instance!="isatap.*"
              | bucket _time span=1m 
              | eventstats avg(Value) as connsByHost by _time | stats sum(connsByHost) as CurrentBandwidth by _time ]
          | eval total= exact(totalBytes*8/CurrentBandwidth * 100)
      | stats  values(total)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2015 17:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181905#M186909</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-06T17:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181906#M186910</link>
      <description>&lt;P&gt;Still getting null or 0 on CurrentBandwidth.  The query by itself is producing results though.  I'm checking it by running the query in the brackets by itself (seeing the results), then I tried taking everything before the eval and doing a | table CurrentBandwidth (seeing rows with no data). Thanks for your assistance thus far!&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 18:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181906#M186910</guid>
      <dc:creator>tysonjhayes</dc:creator>
      <dc:date>2015-05-06T18:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181907#M186911</link>
      <description>&lt;P&gt;I now understand. I thing the problem should be the appen command. Change  appen and try use &lt;STRONG&gt;apppencols&lt;/STRONG&gt; or &lt;STRONG&gt;join&lt;/STRONG&gt;. Something like this, with &lt;STRONG&gt;appendcols&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=index host=host object="Network Interface" counter="Bytes Total/sec"
      | bucket _time span=1m
      | stats avg(Value) as bytesByHost by _time,host
      | stats sum(bytesByHost) as totalBytes by _time
      | appendcols [search index=index host=host object="Network Interface" counter="Current Bandwidth" instance!="isatap.*"
          | bucket _time span=1m 
          | stats avg(Value) as connsByHost by _time | stats sum(connsByHost) as CurrentBandwidth by _time ]
      | eval total= exact(totalBytes*8/CurrentBandwidth * 100)
  | stats  values(total)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2015 19:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181907#M186911</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-06T19:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181908#M186912</link>
      <description>&lt;P&gt;Brilliant! That works! Now, what is apppencols? I'm not seeing any documentation on it, or I'm missing something super obivous.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 20:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181908#M186912</guid>
      <dc:creator>tysonjhayes</dc:creator>
      <dc:date>2015-05-06T20:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get Percentage of Network bandwidth</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181909#M186913</link>
      <description>&lt;P&gt;here you go: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Appendcols"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Appendcols&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 21:01:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-Percentage-of-Network-bandwidth/m-p/181909#M186913</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-05-06T21:01:56Z</dc:date>
    </item>
  </channel>
</rss>

