Forum Discussion
Any python experts out there? - parsing tmsh list
Hello PSFletchTheTek,
Have you tried with f5-sdk?
https://f5-sdk.readthedocs.io/en/latest/
It's an easy way to collect the config of "tmsh list" in a parsed way.
Annoyingly,
My collegue has just pointed out, i can't use the SDK in our environment as i'm not allowed to install anything on the customers environment. (forgot that part, i got all existed about the SDK)
So i'm back to processing the tmsh list one-line output.
So if anyone can help me with the parsing that would be awesome!
Fletch
- Jul 02, 2022
Well, all the libraries used in the F5 SDK are open source, so, you can replicate the same code to your own repository. If you install it in your home lab, you will see all the files involved. I recommend you to give it a try.
Take into account that the python philosophy is to reuse the already created libraries and only create something when the current existing library doesn't solve what you are searching for. If this already exists, it doesn't make sense to create the same again. Just my POV.
- Jul 04, 2022
I do agree with you whole heartedly.
But the SDK runs off of the REST API from what i can work out.
Unfortunately i need something i can run offline, with minial tools on the custmer environment.
The concept of the SDK from inside works brillantly, but i don't have control the environment i am working in.So running tmsh list > /var/temp/list_output.txt for example and getting one of the sys admins send it to me works very nicely.
- Jul 04, 2022
Meant to add, if there is any other way i can get this offline and get the sdk to process that file that would be awesome. It's the offline bit that i think is the struggle here
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