Hi,
I'm trying to pre-process some datas which sometime come with different units.
For example, I sometime have this string "Usage: 572.20 MB" and sometime this one "Usage: 17.20 GB".
I use a regex like "(\d+.\d+)" to get the string value and transform it to float, but I cannot always get the right value because of the units.
If I use a regex like "(\d+.\d+\s\S+)" to get the unit, than I have an error message that I cannot have a string in a float zabbix item.
What's the best way to process with such datas ?
Thanks
I'm trying to pre-process some datas which sometime come with different units.
For example, I sometime have this string "Usage: 572.20 MB" and sometime this one "Usage: 17.20 GB".
I use a regex like "(\d+.\d+)" to get the string value and transform it to float, but I cannot always get the right value because of the units.
If I use a regex like "(\d+.\d+\s\S+)" to get the unit, than I have an error message that I cannot have a string in a float zabbix item.
What's the best way to process with such datas ?
Thanks
Comment