Dashboards & Visualizations

Converting MB to GB

kesrich
Explorer

Hi, I am very new to Splunk reporting and I am trying to change a timechart I have to show in GB since we are using a 4TB disk share. Below is my search query. It comes up OK, but just trying to make it more friendly.

index=perfmon host=ServerName eventtype=perfmon_windows NetShare14| timechart span=24h avg(Free_Megabytes) as MB_Free

Thanks

Kesrich

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Use eval to convert the values.

index=perfmon host=ServerName eventtype=perfmon_windows NetShare14
| eval GB_Free = Free_Megabytes/1024
| timechart span=24h avg(GB_Free) as GB_Free
---
If this reply helps you, Karma would be appreciated.

View solution in original post

kesrich
Explorer

Thanks everyone for the suggestions. I wasn't familiar with "eval". That helped.

 

0 Karma

niketn
Legend

Actually reverse perform timechart to get daily data hoping even if you are querying 1 year of data it will be 365 rows. Then apply eval

index=perfmon host=ServerName eventtype=perfmon_windows NetShare14
| timechart span=24h avg(Free_Megabytes) as GB_Free
| eval GB_Free=round(GB_Free,2)

Read more about eval command in Splunk Documentation: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

MattibergB
Path Finder

You could try to use the following before your timechart: | eval GB_Free=(Free_Megabytes/1024).

Then change your timechart to the following:

| timechart span=24h avg(GB_Free) as GB_Free

richgalloway
SplunkTrust
SplunkTrust

Use eval to convert the values.

index=perfmon host=ServerName eventtype=perfmon_windows NetShare14
| eval GB_Free = Free_Megabytes/1024
| timechart span=24h avg(GB_Free) as GB_Free
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...