Scripted fields Mb to bytes

Hello

There is some way to convert Mb to bytes. I have a field where Mb and sometimes bytes come, but I want it to always be bytes or that number (1.9 Mb = 1.9e + 6 bytes) multiply it to be bytes.

Thanks for your support

Unfortunately, no. If you were storing the byte value, you could use a field formatter to convert it to megabytes, but there's not a formatter that would allow you to go the other way.

You could enrich the data at index time to store both values (bytes and megabytes), if you need to store, or only have access to, the megabyte value. This can be done as part of your ingest process, via Logstash if you're already using that, using an ingest node, as some possible solutions.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.