Action paramter query issue

Hello Team
Hope Every One is doing Good !
I am trying to change some data in a QRadar config file. and as part of that I have written an Action script to do the job… When I put a prompt in the task to append the details… which is not working . however when I manually give the data it is working… Please help me

Action Script :

//Prompt the window
action parameter query “QRadar” with description “QRadar Server IP:”
//QRadar Server IP Details
appendfile {parameter “QRadar”}
// iterate through the file replacing lines as necessary
appendfile {concatenation “%0d%0a” of ( if (it starts with “ConfigurationServer=”) then “ConfigurationServer=”{parameter “QRadar”} else it as string) of ( if (it starts with “StatusServer=”) then “StatusServer=”{parameter “QRadar”} else it as string) of lines of file (parameter “filename”)}

Error I Get when I run this action:

Command succeeded action parameter query “QRadar” with description “QRadar Server IP:” (action:334492)
Command succeeded appendfile {parameter “QRadar”} (action:334492)
Command succeeded (file created) appendfile 10.10.10.10 (action:334492)
Command succeeded appendfile 10.10.10.10 (action:334492)
Command failed (Relevance substitution failed) appendfile {concatenation “%0d%0a” of ( if (it starts with “ConfigurationServer=”) then “ConfigurationServer=”{parameter “QRadar”} else it as string) of ( if (it starts with “StatusServer=”) then “StatusServer=”{parameter “QRadar”} else it as string) of lines of file (parameter “filename”)}

I don’t think you can put relevance inside relevance: { } inside { } Try replacing the inner curly brackets with parenthesis:

appendfile {concatenation “%0d%0a” of ( if (it starts with “ConfigurationServer=”) then “ConfigurationServer=”(parameter “QRadar”) else it as string) of ( if (it starts with “StatusServer=”) then “StatusServer=”(parameter “QRadar”) else it as string) of lines of file (parameter “filename”)}

Hello Cstoneba

Thank you so much for your reply… I’ve tried using paranthesis… but the result is same…

Command failed (Relevance substitution failed) appendfile {concatenation “%0d%0a” of ( if (it starts with “ConfigurationServer=”) then “ConfigurationServer=”(parameter “QRadarIP”)

you need to “&” your string and parameter values.

appendfile {concatenation “%0d%0a” of ( if (it starts with “ConfigurationServer=”) then “(ConfigurationServer=” & (parameter “QRadar”)) else it as string) of ( if (it starts with “StatusServer=”) then (“StatusServer=” & (parameter “QRadar”)) else it as string) of lines of file (parameter “filename”)}

You are trying to use parameter "filename" but you have not defined a value for it.

(In addition to the relevance-inside-relevance issue already noted)

Thank you for your Relay Cstoneba.

Luckly this time it has move to a last setp to move the __appendfile to the actual file… but it is throwing this error.

(action:334511)
Command succeeded delete No ‘C:\Program Files (x86)\IBM\WinCollect\config\Old\install_config.bak.bak’ exists to delete, no failure reported (action:334511)
Command succeeded move “C:\Program Files (x86)\IBM\WinCollect\config\install_config.txt” “C:\Program Files (x86)\IBM\WinCollect\config\Old\install_config.bak.bak” (action:334511)
At 13:17:10 -0400 -
Retry error, attempt 9 failed for MoveFile (E:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\actionsite__appendfile ,C:\Program)
Command failed (Move of ‘E:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\actionsite__appendfile’ to ‘C:\Program’ failed (0 - )) move __appendfile C:\Program Files (x86)\IBM\WinCollect\config\install_config.txt (action:334511)
At 13:17:10 -0400 -