Forum Discussion

Thiyagu's avatar
Thiyagu
Icon for Cirrus rankCirrus
May 28, 2019

Grep command help to search and print the lines between the matches

Hello All,

I'm working to get the complete configuration of VIP from the "/" using recursive search. Below command is working to get the configuration of a VIP and it print 75 lines after the search by this way configuration of an other VIP is also getting printed.

 

show running-config ltm recursive virtual all-properties | grep "VIP_NAME" -A 75

 

Can u help to further tune the search with start string of "VIP NAME" and print the lines and it should stop if there is a match for the string "vs-index"

 

Regards,

Thiyagu

 

 

2 Replies

  • You have to run the same command from outside of TMSH shell (I mean Bash shell).

    tmsh -q -c "cd / ; show running-config ltm recursive virtual all-properties" | awk '/VIP_NAME/,/vs-index/'

    KR,

    Dario.