Urgent help please: Renaming log to file path name- Adding a custom variable using Jscript


Currently my log to file path is: C:\KiwiSyslog\%HostName\%DateISO.txt

However, I want the path to be C:\KiwiSyslog\%HostName\%CustomVariable01\%DateISO.txt

I am trying to write a script where the custom variable is assigned a value depending on the HostIP Address (if  %HostName is then CustomVariable01 is "XYZ"). 

This is the script I have- 

function main(){
var HostName= VarPeerAddress;
var customVariable= "undefined";
if (HostName=
return customVariable;
var customeVariable= "unidentified";
return customVariable;
VarCustom01 = customVariable;
return "OK";

Can someone help me with the correct syntax of the JScript? Thanks