Forum Discussion
Need to apply profile with script
Hi All,
Need some help in creating a script in which I have to apply X-forwarded-for feature enabled http profile on already working 100's of VIPs on physical or virtual load balancer.
Thanks in advance!!!
Best Regards,
Ashish Solanki
Hello Ashish
1) awk '{ print $3 }' = separate the previous output by spaces and take the third value.
https://en.wikipedia.org/wiki/AWK
2) xargs -l {} = take the stdin (by line) and use it in the next command when characters '{}' are shown.
https://en.wikipedia.org/wiki/Xargs
BTW, I would appreciate if you mark my answer as "the best" or give me some upvote.
KR,
Dario.
Hello Ashish
1) awk '{ print $3 }' = separate the previous output by spaces and take the third value.
https://en.wikipedia.org/wiki/AWK
2) xargs -l {} = take the stdin (by line) and use it in the next command when characters '{}' are shown.
https://en.wikipedia.org/wiki/Xargs
BTW, I would appreciate if you mark my answer as "the best" or give me some upvote.
KR,
Dario.
Hello.
You can do it in four simple steps
1) Capture all VS configured in '/Common' partition
# tmsh list ltm virtual one-line | awk '{ print $3 }' > output.txt
2) Manually remove from 'output.txt' those VS that you don't want to modify
3) Change the HTTP profile in all VS in that list
# cat output.txt | xargs -I {} tmsh modify ltm virtual {} profiles add { <new_http_profile> } profiles delete { <current_http_profile> }
4) Save config from running-config to startup-config
# tmsh save sys config
KR,
Dario.
Hi Dario,
Thanks for the script it worked perfectly as I wanted.
Can you help me understand few things in the script :
- In awk '{ print $3 }' what is print $3
- xargs -I {} --> please help me understand this
Thanks again for your help.
Best Regards
Ashish Solanki
Thanks a lot again :), Dario.
Need some more help. I'm preparing for 201 exam I have taken this exam and would like to share result with you and need your feedback on the ones which are not correct.
Also, are you on LinkedIn I would like to add you as my connection if you don't mind.
Thanks in advance!!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com