Open for Voting

SWQL functions for IP Addresses

Since Solarwinds is all about managing IP Addresses, there should be some functions that aid with exactly that like INET_ATON, INET_NTOA, IS_IPV4, IS_IPV6 & ... (MySQL :: MySQL 8.0 Reference Manual :: 12.23 Miscellaneous Functions ).

Short of that, it'd be helpful to have:

1. A c# style split function to parse out octets, (yes there's a SUBSTRING, but it and CHARINDEX are clunky).

2. A sort mechanism that orders by numerical parts (.net - How to sort list of Ip Addresses using c# - Stack Overflow )

More string parsing is needed in general:

Having to do something like the following to sort by IP Address is fairly obscure:

SELECT DisplayName
     , IPAddress
     , 0 + ToString(ARRAYVALUEAT(SPLITSTRINGTOARRAY(REPLACE(IPAddress,'.','|§|§|')),0)) AS O1
     , 0 + ToString(ARRAYVALUEAT(SPLITSTRINGTOARRAY(REPLACE(IPAddress,'.','|§|§|')),1)) AS O2
     , 0 + ToString(ARRAYVALUEAT(SPLITSTRINGTOARRAY(REPLACE(IPAddress,'.','|§|§|')),2)) AS O3
     , 0 + ToString(ARRAYVALUEAT(SPLITSTRINGTOARRAY(REPLACE(IPAddress,'.','|§|§|')),3)) AS O4
FROM Orion.Nodes
ORDER BY O1,O2,O3,O4