I am trying to query IP addresses from Forefront Firewall logs, and I am a little stuck on the IP formatting
C0A8E008-FFFF-0000-0000-000000000000
Can anyone give me the MSSQL command to turn this into standard human redable?
UPDATE, I now see that I kust need to convert the first 8 charecters from hex to decimal....which I can then convert to IP. the trick is to parse those first charecters from the field with SQL
You can use substring function to get the four octets of IP address. You can do:
I am not sure whether MSSQL has a function that does hex to decimal conversion
hex_to_sec
. You just need to find a proper way to implement it.I don't know how to do it in MSSQL but to give you an idea of the method, in your example above C0A8E008 is 192.168.224.08. Split C0A8E008 into four 2 hexdigit blocks and convert each into decimal.