How can I force a value to be text during preprocessing?
Background:
I'm monitoring the latest archived WAL with pgBackRest. I get these kind of JSON replies:
I can extract it with preprocessing JSONPath "$.max", no problem there.
However, I want to use "Discard", but it discards is currently "too much". Values 000000050000002900000018 and 000000050000002900000019 are treated as equal (!). Why? I think zbx_variant_compare() in src/libs/zbxvariant/variant.c is too blame:
Zabbix seems to auto upgrade a string to a double, if possible. Why are the values the same? Because they ARE the same when converted to a double:
(A double simply does not have the precision for my data.) But my data is NOT a double, it is text. "00000005000000290000001A" is also a valid value for instance.
I already tried several text preprocessing options, like regex replace .* with \0, but doesn't seem to force text type.
My situation: Zabbix 7.0.18
Background:
I'm monitoring the latest archived WAL with pgBackRest. I get these kind of JSON replies:
Code:
{"archive":[{"max":"000000050000002900000018"}]}
However, I want to use "Discard", but it discards is currently "too much". Values 000000050000002900000018 and 000000050000002900000019 are treated as equal (!). Why? I think zbx_variant_compare() in src/libs/zbxvariant/variant.c is too blame:
Code:
661:int zbx_variant_compare(const zbx_variant_t *value1, const zbx_variant_t *value2)
662:{
(...)
678: if ((ZBX_VARIANT_STR != value1->type || SUCCEED == zbx_is_double(value1->data.str, NULL)) &&
679: (ZBX_VARIANT_STR != value2->type || SUCCEED == zbx_is_double(value2->data.str, NULL)))
680: {
681: return variant_compare_dbl(value1, value2);
682: }
Code:
000000050000002900000018 == 0x436634579b73efa2 000000050000002900000019 == 0x436634579b73efa2
I already tried several text preprocessing options, like regex replace .* with \0, but doesn't seem to force text type.
My situation: Zabbix 7.0.18
Comment