Skip to main content
shashankkumar
New Member
November 29, 2024
Question

Change output format and update it in web server text file.

  • November 29, 2024
  • 1 reply
  • 963 views

Hi Team,

 

I have output as DestIP = ['1.1.1.','1.1.1.2'] and I want to update this in a text file of server which i have integrated using SSH connector, while trying to update it is getting updated as it is ['1.1.1.','1.1.1.2'] but I want to update these mutiple IPs in text file of server in a vertical format without any brackets and commas. For example, refer below:

 

Is there any utility to change the format like this ? 

 

1.1.1.1

1.1.1.2

 

Regards,

Shashank

1 reply

rosatechnocrat
Explorer III
November 30, 2024

Yeah I can provide you the utility. 

Can you share a more of sample text. 

Subscribe "ROSA Technocrat" on Youtube for Fortinet Videos and Troubleshooting https://www.youtube.com/@rosatechnocrat
shashankkumar
New Member
December 4, 2024

 Hi  Rosa,

 

If you see attached images, from FortiSOAR we are getting IP output in list format under "nice_ip" key and I am sending this IP to update in text file of web server which i have integrated using SSH connector and I am using command "echo -e '{{vars.nice_ip}}' >> /var/test.txt" to update. Now I want the IPs to be updated in text file as one IP per line without additional bracket or commas, but it is getting updated as ['10.67.0.254', '10.77.0.254'] in single line. 

 

==

sample:

 

"nice_ip": [
"198.224.171.135",
"198.224.169.135"
],