Custom var not interpreted as numeric in filter #951
Labels
difficulty/hard
You can do this! Just ask someone for input first, please. And demand (some of) it as comment here!
enhancement
New feature or improvement
Hello,
Describe the bug
I created a customer variable as a numeric var.
Based on this variable, I want to retrieve all services (same problem in host) that the numericvar is lower then 100.
the result is that he doesn't find any matches.
If I look via the format=sql option I see:
If I run the SQL directly in Postgres I get an error:
This is correct because the flatvalue is a text field.
Expected behavior
I expect that if you provide a numeric value, it will be interpreted as a numeric and not as a string
For me there is a difference if you give in the filter
or
Possible solution
If a numeric value has been specified in the filter, the "flatvalue" will be converted to a numeric value
When I use CAST in Postgresql it correctly interprets the flatvalue as a numeric value
Your Environment
I am using the latest snapshot of the icinga,icingadb,icingaweb2,icingadb-web (SNAPSHOT on 16dec2023)
EDB Postgresql : 14
The text was updated successfully, but these errors were encountered: