Dashboards & Visualizations

how convert byte to Mb

soheilamiri
Explorer

hello guys

i am new in splunk world, i want to create a report that show total inbound traffic in Mb. here is my search code : 

 

 

 

 

 

sourcetype=fgt_traffic dest=1.1.1.* NOT (src=1.1.1.* OR dest=skyroom.online) bytes_in>0 AND action ="allowed"

 

 

 

 

 

and here is my pivot visual with table entry.

splunk1.JPG 

Labels (1)
0 Karma
1 Solution

soheilamiri
Explorer

hi @scelikok thanks for your answer

i customize our code : 

sourcetype=fgt_traffic dest=0.0.0.0 NOT (src=0.0.0.0 OR dest=test.com) bytes_in>0 NOT action ="blocked" 
| stats  sum(bytes_in) as "Total Traffic Receive" by dstip
| eval "Total Traffic Receive"=round('Total Traffic Receive'/10240/1024,2)
| rename dstip as "DMZ Server"

 it's work perfect.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

@soheilamiri, changing timechart command to stats should work;

sourcetype=fgt_traffic dest=1.1.1.* NOT (src=1.1.1.* OR dest=skyroom.online) bytes_in>0 AND action ="allowed" 
| stats count(srcip) as From eval(round(sum(bytes_in)/1024/1024,2)) as "Total Traffic Receive" values(dstport) as Port by dstip | rename dstip as"DMZ Server"

 

If this resolves your issue, an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

soheilamiri
Explorer

hi @scelikok 

i get this error : 

Error in 'stats' command: The argument 'eval(round(sum(bytes_in)/1024/1024,2))' is invalid.
 
Tags (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Sorry @soheilamiri, I wrote without testing, below should work

sourcetype=fgt_traffic dest=1.1.1.* NOT (src=1.1.1.* OR dest=skyroom.online) bytes_in>0 AND action ="allowed" 
| stats count(srcip) as From sum(bytes_in) as "Total Traffic Receive" values(dstport) as Port by dstip 
| eval "Total Traffic Receive"=round('Total Traffic Receive'/1024/1024,2)
| rename dstip as"DMZ Server"

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

soheilamiri
Explorer

hi @scelikok thanks for your answer

i customize our code : 

sourcetype=fgt_traffic dest=0.0.0.0 NOT (src=0.0.0.0 OR dest=test.com) bytes_in>0 NOT action ="blocked" 
| stats  sum(bytes_in) as "Total Traffic Receive" by dstip
| eval "Total Traffic Receive"=round('Total Traffic Receive'/10240/1024,2)
| rename dstip as "DMZ Server"

 it's work perfect.

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @soheilamiri, please try below;

sourcetype=fgt_traffic dest=1.1.1.* NOT (src=1.1.1.* OR dest=skyroom.online) bytes_in>0 AND action ="allowed" 
| timechart count(srcip) as From eval(round(sum(bytes_in)/1024/1024,2)) as "Total Traffic Receive" values(dstport) as Port by dstip | rename dstip as"DMZ Server"
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

soheilamiri
Explorer

Hi @scelikok 

thanks for reply. the output of suggested script is not what i aspect.

here is IMAGE  that show more details. the X axis should be dest and the Y axis should be Bytes_in in Mb.

how can i create this chart with my specific visual.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...