Creating an IP address list with multiple lines

I’m trying to create a file on the monitored systems of the IP addresses BigFix is reporting so I can match them to match it up with a file from another system. However, when I run the commands:

delete createfile
createfile until end 
{addresses whose (it as string != "0.0.0.0") of ip interfaces whose (not loopback of it) of network as string} 
end 
wait rm /opt/XXX/automation/results/IPlist.txt 
copy __createfile /opt/XXX/automation/results/IPlist.txt

The result in IPlist.txt winds up being in a single line. This works great if you have only one IP address, but with multiple addresses, it renders the file useless for grepping into the other file.

I’m sure I’m missing something here with a “separated by” clause but I’m at my wit’s end trying to figure out what’s the correct way to get this working.

As usual, thanks for your assistance!

You have to embed the newline character ("%0d%0a" on Windows, I believe just “%0a” on UNIX/Linux) into the output. Try

edit: Fixed the Relevance statement per what @KSheldon300 reports works, for the sake of future Googlers. My original was missing a parentheses affecting the casting “as string”.

2 Likes

You were close - I started with what you gave me and the fixlet failed. However, when I put the original part in parentheses, like this:

{concatenation “%0a” of (addresses whose (it as string != “0.0.0.0”) of ip interfaces whose (not loopback of it) of network as string)}

the statement worked properly.

Thanks for setting me on the right track.

Glad to know it’s helping. I fixed my relevance to match.