Finding the IP address in kdb? - Kdb+ / qStudio

Home Forums Kdb+ / qStudio Finding the IP address in kdb?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #111314

    John Dempster
    Keymaster

    How do I find the IP address and hostname in kdb?

    .z.a – returns the raw ip address as an integer
    .Q.host – returns the hostname for a given ipAddress / integer

    e.g.

    `

    q).z.a / returns the raw ip address as an integer
    -1062717439i
    q)0x0 vs .z.a / convert to bytes
    0xc0a83801
    q)”h”$0x0 vs .z.a / then short numbers
    192 168 56 1h
    q)”.” sv string”h”$0x0 vs .z.a / finally string and concatenate them
    “192.168.56.1”`

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.