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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...