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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...