I have a field [B] that consists of some numbers and strings.
10 gb
20 gb
30 gb
I would like to implement a eval statement that would convert the numerical values into MB.
B=*"GB"| eval GB=*/1024 | table GB
I'm not sure what is incorrect about this statement?
if you have a 'string' field, first get the numeric value (i am using the rex command here)
then multiply the extracted value (field: numericB) with 1024 to get the MB...
| rex field=B "\D?(?<numericB>\d*)\D?"
| eval MB=numericB*1024
| table MB