<?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 How to group disparate data in stats (Interface Names and Routers) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138199#M37926</link>
    <description>&lt;P&gt;Here is my sample data:&lt;/P&gt;

&lt;P&gt;CoreRouter      peer            uplink          speed&lt;/P&gt;

&lt;P&gt;--&lt;/P&gt;

&lt;P&gt;Core1.stl       gw1.stlouis     fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core2.stl       gw1.stlouis     fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core1.bos       gw1.boston      fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core2.bos       gw1.boston      fe-0/1          100000&lt;/P&gt;

&lt;P&gt;When I run this search, I get the following output:&lt;/P&gt;

&lt;P&gt;[search] | stats latest(bps_out) AS CurrentBPS BY CoreRouter,Uplink,peer,speed | stats sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS by peer,Uplink | eval Util=round((CurrentBPS/MaxSpeed)*100)&lt;/P&gt;

&lt;P&gt;peer            count   UpLink          MaxSpeed        CurrentBPS      Util&lt;/P&gt;

&lt;P&gt;gw1.stlouis     2       fe-0/0          200000          120620          60&lt;/P&gt;

&lt;P&gt;gw1.boston      1       fe-0/0          100000          38634           39&lt;/P&gt;

&lt;P&gt;gw1.boston      1       fe-0/1          100000          37506           38&lt;/P&gt;

&lt;P&gt;What's happening is that I need to group uplinks together per CoreRouter. When the uplinks are the same name (ie: fe-0/0) they are grouped together so I get the aggregate of both links, which is what I want. But when the uplink names are different (ie: fe-0/0 &amp;amp; fe-0/1), they don't get grouped together which prevents me from getting the aggregate data I need.&lt;/P&gt;

&lt;P&gt;How can I group together uplinks in the same CoreRouter, but have different uplink names? In the example above, how can two links in Core1/2.bos be grouped together while also maintaining the aggregation of Core1/2.stlouis? What I should end up with is something like this:&lt;/P&gt;

&lt;P&gt;peer            count   MaxSpeed        CurrentBPS      Util&lt;/P&gt;

&lt;P&gt;gw1.stlouis     2       200000          120620          60&lt;/P&gt;

&lt;P&gt;gw1.boston      2       200000          76140           38&lt;/P&gt;

&lt;P&gt;NOTE: I don't need the Uplink interface name to be displayed in the output. I just listed it above to show the differences in the data.&lt;/P&gt;

&lt;P&gt;Thanks, &lt;/P&gt;</description>
    <pubDate>Tue, 22 Apr 2014 13:32:24 GMT</pubDate>
    <dc:creator>albyva</dc:creator>
    <dc:date>2014-04-22T13:32:24Z</dc:date>
    <item>
      <title>How to group disparate data in stats (Interface Names and Routers)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138199#M37926</link>
      <description>&lt;P&gt;Here is my sample data:&lt;/P&gt;

&lt;P&gt;CoreRouter      peer            uplink          speed&lt;/P&gt;

&lt;P&gt;--&lt;/P&gt;

&lt;P&gt;Core1.stl       gw1.stlouis     fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core2.stl       gw1.stlouis     fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core1.bos       gw1.boston      fe-0/0          100000&lt;/P&gt;

&lt;P&gt;Core2.bos       gw1.boston      fe-0/1          100000&lt;/P&gt;

&lt;P&gt;When I run this search, I get the following output:&lt;/P&gt;

&lt;P&gt;[search] | stats latest(bps_out) AS CurrentBPS BY CoreRouter,Uplink,peer,speed | stats sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS by peer,Uplink | eval Util=round((CurrentBPS/MaxSpeed)*100)&lt;/P&gt;

&lt;P&gt;peer            count   UpLink          MaxSpeed        CurrentBPS      Util&lt;/P&gt;

&lt;P&gt;gw1.stlouis     2       fe-0/0          200000          120620          60&lt;/P&gt;

&lt;P&gt;gw1.boston      1       fe-0/0          100000          38634           39&lt;/P&gt;

&lt;P&gt;gw1.boston      1       fe-0/1          100000          37506           38&lt;/P&gt;

&lt;P&gt;What's happening is that I need to group uplinks together per CoreRouter. When the uplinks are the same name (ie: fe-0/0) they are grouped together so I get the aggregate of both links, which is what I want. But when the uplink names are different (ie: fe-0/0 &amp;amp; fe-0/1), they don't get grouped together which prevents me from getting the aggregate data I need.&lt;/P&gt;

&lt;P&gt;How can I group together uplinks in the same CoreRouter, but have different uplink names? In the example above, how can two links in Core1/2.bos be grouped together while also maintaining the aggregation of Core1/2.stlouis? What I should end up with is something like this:&lt;/P&gt;

&lt;P&gt;peer            count   MaxSpeed        CurrentBPS      Util&lt;/P&gt;

&lt;P&gt;gw1.stlouis     2       200000          120620          60&lt;/P&gt;

&lt;P&gt;gw1.boston      2       200000          76140           38&lt;/P&gt;

&lt;P&gt;NOTE: I don't need the Uplink interface name to be displayed in the output. I just listed it above to show the differences in the data.&lt;/P&gt;

&lt;P&gt;Thanks, &lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138199#M37926</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-04-22T13:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to group disparate data in stats (Interface Names and Routers)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138200#M37927</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search] | stats latest(bps_out) AS CurrentBPS values(uplink) as uplink BY CoreRouter ,peer,speed | stats count, sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS by peer,Uplink | eval Util=round((CurrentBPS/MaxSpeed)*100)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H2&gt;Update&lt;/H2&gt;

&lt;P&gt;try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search] | stats latest(bps_out) AS CurrentBPS BY CoreRouter,Uplink ,peer,speed | stats count, sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS values(uplink) as uplink by peer | eval Util=round((CurrentBPS/MaxSpeed)*100)

OR 
[search] | stats latest(bps_out) AS CurrentBPS BY CoreRouter,Uplink ,peer,speed | stats count, sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS by peer | eval Util=round((CurrentBPS/MaxSpeed)*100)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The output should be like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;peer        uplink   count MaxSpeed CurrentBPS Util   

gw1.stlouis  fe-0/0  2     200000   120620     60  

gw1.boston   fe-0/0  2     200000   76140      38
             fe-0/1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138200#M37927</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-22T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to group disparate data in stats (Interface Names and Routers)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138201#M37928</link>
      <description>&lt;P&gt;No luck. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What's happening in the Search is this:&lt;/P&gt;

&lt;P&gt;CoreRouter Uplink bps_out&lt;/P&gt;

&lt;P&gt;Core1.stl fe-0/0 38634&lt;BR /&gt;
Core2.stl fe-0/1 37506&lt;/P&gt;

&lt;P&gt;I then run the data through a CVS file (| lookup uplinks.csv CoreRouter as CoreRouter Uplink as Uplink OUTPUT speed peer). In the CVS file it just has the Core Router, Uplink, Peer, and speed of the link.&lt;/P&gt;

&lt;P&gt;From that, I then add in the stats:&lt;BR /&gt;
| stats latest(bps_out) AS CurrentBPS BY CoreRouter,Uplink,peer,speed | stats sum(speed) AS MaxSpeed, sum(CurrentBPS) AS CurrentBPS by peer,Uplink | eval Util=round((CurrentBPS/MaxSpeed)*100)&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138201#M37928</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-04-22T13:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to group disparate data in stats (Interface Names and Routers)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138202#M37929</link>
      <description>&lt;P&gt;On the Update, it do see that it's now displaying the interfaces, but it's not aggregating the those with disparate interface names together.&lt;/P&gt;

&lt;P&gt;I'm no so sure | stats    is up to the job. Maybe I need a |transaction entry?  Cause splunk needs to identify every interface associated with a peer and then add up their data.&lt;/P&gt;

&lt;P&gt;I might have to go back to the drawing board on this one.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2014 14:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-disparate-data-in-stats-Interface-Names-and-Routers/m-p/138202#M37929</guid>
      <dc:creator>albyva</dc:creator>
      <dc:date>2014-04-22T14:41:06Z</dc:date>
    </item>
  </channel>
</rss>

