skip to Main Content

I have this query to check the application version

AppInventory_CL
| extend AppVersion_s_Dyn = split(AppVersion_s, '.')
| extend Versione = iif(toint(AppVersion_s_Dyn[0]) >= 5 
    and toint(AppVersion_s_Dyn[1]) >= 2 
    and toint(AppVersion_s_Dyn[2]) >= 7, 'OK', 'KO')

But I need that also superior versions such as 6.0.5 is OK.
How can I do that?
Thanks

2

Answers


  1. Chosen as BEST ANSWER

    Yes I saw it but If I use parse_version the version for example 5.2.7 became 5000000020000000700000000 and if I try this

    | extend Versione = iff(parse_version(AppVersion_s) >= 5000000020000000700000000, 'OK', 'KO')

    I have this error

    Query could not be parsed at '5000000020000000700000000' on line [7,56] Token: '5000000020000000700000000' Line: 7 Postion: 56


  2. Presuming the versions are well formatted, you might want to use the parse_version function?

    See
    https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/parse-versionfunction

    where that function might do what you want, and then you can use standard equals/greater than operators on the version strings?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search