How to map memory size

I have fields that are currently being ingested as

resources_used.vmem: 1028974kb
resources_requested.vmem: 2000000kb

They are mapped as keyword, but i would like to have the "kb" (or file size denom.) stripped and to store them as a Numeric so i can query. What would be the best way to do this?

Use an ingest pipeline with this processor: Bytes processor | Elasticsearch Guide [8.14] | Elastic