declare local var.ip IP; declare local var.ipver STRING; set var.ip = req.http.Fastly-Client-IP; set var.ipver = if(addr.is_ipv4(var.ip), "4", if (addr.is_ipv6(var.ip), "6", "?")); log "ip=" + var.ip + "&ip_version=" + var.ipver;