How to convert ip4addr to string

View thread

Little_Rock

the following context is my Input configuration and i get a functong from the manual doc,  but the return value of hos_ip() is ip4addr, and I want to convert the return value to string, I have try the string() function, but it does not work at all. Is there any way to convert the return value to string so i can and a new filed of the Input configuration.

ip4addr host_ip();
description Return the first non-loopback IP address the hostname resolves to.
return type ip4addr

 

<Input 59dcb7a6dd48cb088969e300>
        Module im_file
        File '/usr/local/nginx_raw/logs/access.log'
        PollInterval 1
        SavePos True
        ReadFromLast True
        Recursive True
        RenameCheck False
        Exec $FileName = file_name(); # Send file name with each message
        Exec $HOSTIP = host_ip();
</Input>