Forum Discussion
HisMorty
May 11, 2023Nimbostratus
How to get plain text conditions and actions from each rule in policy?
I try rest api, but i get json not plain text, anybody know how to get plain text conditions and actions rules in policy how it look like in GUI. Tmsh gave json too. if anybody have idea, please writ...
Torijori_Yamamada
Cirrus
Hello,
While you referring as "plain text" you mean ... ?
I'm asking because of the tmsh gives it as config lines as stored in bigip.conf file which is not JSON, it is "plain text".
tmsh list ltm policy Stop_Nimda ltm policy StopNimda{ controls { forwarding } description "This policy blocks the Nimda worm." last-modified 2016-03-02:11:46:00 requires { http } rules { ClobberNimda { actions { 0 { forward reset } } conditions { 0 { http-uri query-string values { root.exe admin.dll cmd.exe } } } } } status published strategy first-match }
If you need to remove "{" and "}" characters in the output, use same command with appending at the end of
- | sed -e 's,{\|},,g'
If you also need to get rid of those blank lines in the output, append below too
- | sed -e '/^ *$/d'
Hope this helps
HisMorty
May 12, 2023Nimbostratus
i meant i need this plaintext. Cause text by tmsh not good readable
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects