Reporting

How to generate report of Bandwidth usage per user and URL

newcomer
Engager

Hi,

 

I'm trying to generate a report with the following information

-Total Bandwidth for each user

-List of top 3 (Bandwidth usage) URLs for each user

-Bandwidth for each URL

For example

Example.JPG

 

Thank you!

Labels (2)
0 Karma
1 Solution

marysan
Communicator

I can't understand URL Category field role ! so I did it without considering URL Category
In addition I converted bytes to MB AND GB with division to 3145728 and 1073741824
this must work for you :

index=Myindex  url=* user="*" bytes=*

|eventstats sum(bytes) as TotalBandwidth_user by user
| eval TotalBandwidth_user=(TotalBandwidth_user/1073741824)
|eventstats sum(bytes) as TotalBandwidth_url by url
| eval TotalBandwidth_url=(TotalBandwidth_url/3145728)
| table user,TotalBandwidth_url,TotalBandwidth_user,url
| dedup user,TotalBandwidth_url,TotalBandwidth_user,url
|sort -TotalBandwidth_url
| stats list(url) as url , list(TotalBandwidth_url) as TotalBandwidth_url , values(TotalBandwidth_user) as TotalBandwidth_user(GB) by user
| eval top_TotalBandwidth_url(MB)=mvindex(TotalBandwidth_url,0,2)
| eval top_url=mvindex(url,0,2)
| table user,TotalBandwidth_user(GB),top_url,top_TotalBandwidth_url(MB)

View solution in original post

marysan
Communicator

I can't understand URL Category field role ! so I did it without considering URL Category
In addition I converted bytes to MB AND GB with division to 3145728 and 1073741824
this must work for you :

index=Myindex  url=* user="*" bytes=*

|eventstats sum(bytes) as TotalBandwidth_user by user
| eval TotalBandwidth_user=(TotalBandwidth_user/1073741824)
|eventstats sum(bytes) as TotalBandwidth_url by url
| eval TotalBandwidth_url=(TotalBandwidth_url/3145728)
| table user,TotalBandwidth_url,TotalBandwidth_user,url
| dedup user,TotalBandwidth_url,TotalBandwidth_user,url
|sort -TotalBandwidth_url
| stats list(url) as url , list(TotalBandwidth_url) as TotalBandwidth_url , values(TotalBandwidth_user) as TotalBandwidth_user(GB) by user
| eval top_TotalBandwidth_url(MB)=mvindex(TotalBandwidth_url,0,2)
| eval top_url=mvindex(url,0,2)
| table user,TotalBandwidth_user(GB),top_url,top_TotalBandwidth_url(MB)

newcomer
Engager

Thank you so much, Marysan!

That's exactly what I wanted.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...