Splunk Search

How to convert Bytes to Mbytes in a search?

blebit
Path Finder

Hi everyone

I have this field: File_Size="File size (bytes): [byte_size]", where byte_size is nr; e.g File_Size="File size (bytes): 14642"... and I want to convert it to MB

Can anyone help me on this?

Thank you

richgalloway
SplunkTrust
SplunkTrust

Do this.

... | eval MB_size=byte_size/(1024*1024) | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

rafamss
Contributor

Hi blebit,

First, I'll a regex for get this content like as : rex max_match=0 "(?File_Size="File size (bytes): =.*)" ;
Second, I would do a simple multiplication of the field Bytes per 1000 or 1024, as you see fit.

I hope have help.

Rafael Martins

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...