Closed junaid360 closed 4 years ago
try: SELECT SUM(s.Traffic) AS SumOfTraffic, s.Time FROM ( SELECT MAX(i.OutMaxBps) AS Traffic, DOWNSAMPLE(i.ObservationTimestamp) AS Time, i.InterfaceID FROM Orion.NPM.InterfaceTraffic i WHERE i.ObservationTimestamp BETWEEN $from AND $to AND i.InterfaceID IN ( SELECT InterfaceID FROM Orion.NPM.InterfacesCustomProperties WHERE CarrierName= 'Provider') GROUP BY DOWNSAMPLE(i.ObservationTimestamp), i.InterfaceID ) s GROUP BY s.Time
Worked like a charm, you are genius, thank you
On Wed, Jun 10, 2020 at 2:41 PM njoylif notifications@github.com wrote:
try: SELECT SUM(s.Traffic) AS SumOfTraffic, s.Time FROM ( SELECT MAX(i.OutMaxBps) AS Traffic, DOWNSAMPLE(i.ObservationTimestamp) AS Time, i.InterfaceID FROM Orion.NPM.InterfaceTraffic i WHERE i.ObservationTimestamp BETWEEN $from AND $to AND i.InterfaceID IN ( SELECT InterfaceID FROM Orion.NPM.InterfacesCustomProperties WHERE CarrierName= 'Provider') GROUP BY DOWNSAMPLE(i.ObservationTimestamp), i.InterfaceID ) s GROUP BY s.Time
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/solarwinds/OrionSDK/issues/230#issuecomment-641946294, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMRZC46XN2ZB2RUYIU22KFTRV5WOJANCNFSM4NZYMNUA .
glad to hear! have fun
Hi. Im trying to sum traffic in a way where I dont have to add all the interfacesIDs. So I made a custom property and called it CarrierName and taged the interface as provider where I want to collect the traffic from. How can I add the below 2 different qrys to achieve this?
SELECT SUM(s.Traffic) AS SumOfTraffic, s.Time FROM ( SELECT MAX(i.OutMaxBps) AS Traffic, DOWNSAMPLE(i.ObservationTimestamp) AS Time, i.InterfaceID FROM Orion.NPM.InterfaceTraffic i WHERE i.ObservationTimestamp BETWEEN $from AND $to AND i.InterfaceID IN (131055, 131250) GROUP BY DOWNSAMPLE(i.ObservationTimestamp), i.InterfaceID ) s GROUP BY s.Time
And the qry the second qry is
SELECT InterfaceID, CarrierName FROM Orion.NPM.InterfacesCustomProperties WHERE CarrierName= 'Provider'