Forum Discussion
Hussein_Ghazy
Nimbostratus
Jun 03, 2016Export tmsh command output to a file ex: txt
Hi All,
I would like to export the tmsh command output to a txt file, is this applicable with tmsh?
Regards
Hussein
tatmotiv
Cirrostratus
Jun 03, 2016Calling tmsh commands directly from bash like Yann suggested is suitable in most cases, but might involve problems when using partitions. Another way to accomplish this would be starting an interactive tmsh as normal, but piping its output to file via tee like this:
bash> tmsh | tee myoutput.txt
root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/Common)(tmos) cd /PA999-Test1/
root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/PA999-Test1)(tmos) list net self
net self FLOATIP-VLAN4091 {
address 10.44.55.250/24
floating enabled
partition PA999-Test1
traffic-group /Common/TG999-Test1
unit 2
vlan VLAN4091
}
net self FLOATIP-VLAN4092 {
address 10.22.33.240/24
floating enabled
partition PA999-Test1
traffic-group /Common/TG999-Test1
unit 2
vlan VLAN4092
}
net self SELFIP-VLAN4092 {
address 10.22.33.238/24
partition PA999-Test1
traffic-group /Common/traffic-group-local-only
vlan VLAN4092
}
net self SELFIP-VLAN4091 {
address 10.44.55.248/24
partition PA999-Test1
traffic-group /Common/traffic-group-local-only
vlan VLAN4091
}
root@(my_lb)(cfg-sync In Sync)(/S1-green-P:Active)(/PA999-Test1)(tmos) quit <--- back to bash
[root@my_lb:/S1-green-P:Active:In Sync] config
[root@my_lb:/S1-green-P:Active:In Sync] config
[root@my_lb:/S1-green-P:Active:In Sync] config ls -lah myoutput.txt
-rw------- 1 root root 1.2K Jun 3 11:42 myoutput.txt <--- This file contains all of your tmsh session
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