code: def get_host_ip(logHost):
          
          s = None
          try:
              s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
              s.connect((logHost, 80))
              ip = s.getsockname()[0]
              return ip
          except Exception:
              return '127.0.0.1'
          finally:
              if s:
                  s.close()
docs: If it is not match your local ip, you should fill the PutLogsRequest
          parameter source by yourself.