question

Kev Riley avatar image
Kev Riley asked

Translate ISA Server logs IP fields

Querying a ISA Server 2006 proxy log database (MSDE), and the one table, WebProxyLog, has a field clientip (bigint), for example '167903820' - any ideas how to turn that back to a IPv4 address?
sql-server-2000msdeisa
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
is that the value in the log file? This is the data source that got me involved with LogParser :D
0 Likes 0 ·
Fatherjack avatar image
Fatherjack answered
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
not sure I would use their function though, may be able to do better . . .
0 Likes 0 ·
Kev Riley avatar image Kev Riley ♦♦ commented ·
Excellent thank you! Not sure why I couldn't find that page - I spent about an hour googling it this morning and kept getting guff. Just need it as a one-off at the mo so that function is good enough for now.
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
The number is the IP address. To split the number back into an IP address, go through the following steps: - convert the number into a 8-digit Hexadecimal number - break it down into 4 2-hex-digit numbers - convert each of those into a decimal number - put back together with dots in the appropriate places... What does that link say?
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

WilliamD avatar image WilliamD commented ·
That is pretty much what the link says
0 Likes 0 ·
Kev Riley avatar image Kev Riley ♦♦ commented ·
> For IP address A.B.C.D the big integer stored is (((A*256+B)*256+C)*256+D They use a function like Convert(varchar(3),Convert(Bigint,@bi) / Convert(Bigint,256*256*256)) + '.' + Convert(varchar(3),Convert(Bigint,@bi) / Convert(Bigint,256*256) % 256) + '.' + convert(varchar(3),Convert(Bigint,@bi) / Convert(Bigint,256) % 256) + '.' + convert(varchar(3),Convert(Bigint,@bi) % Convert(Bigint,256) ) where @bi is the bigint
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.