I have this setup. You can put it into $SPLUNK_HOME/etc/system/local/props.conf and it should work. You may want to have your field called "b" or "bytes" for it to work, or change the config to match your fields. This will auto-calculate kilos, megas and gigas automatically.
[host::*]
priority = 100
EVAL-kilobytes = if(isnotnull(kilobytes),kilobytes,bytes/1024)
EVAL-megabytes = if(isnotnull(megabytes),megabytes,bytes/1024/1024)
EVAL-gigabytes = if(isnotnull(gigabytes),gigabytes,bytes/1024/1024/1024)
EVAL-kb = if(isnotnull(kb),kb,b/1024)
EVAL-mb = if(isnotnull(mb),mb,b/1024/1024)
EVAL-gb = if(isnotnull(gb),gb,b/1024/1024/1024)
You can also use a macro (in the Search UI):
Manager -> Advanced Search -> Search Macros
Name: resize(1)
Arguments: bytes
definition = eval kilobytes = $bytes$/1024| eval megabytes=kilobytes/1024|eval gigabytes/1024
Then you can do your_search | resize(fs)
... View more