I am trying to write an EEM script to extract a line from the output of a show command.
What is the regexp pattern that can help me extract the first line of output? (til the first "\n"). I tried many regexp patterns to no avail.
Just FYI, I ended up with a for loop. It works but not very elegant:
event manager applet test
action 1 cli command "enable"
action 2 cli command "show run | i ip route 220.127.116.11"
action 3 foreach line "$_cli_result" "\n"
action 4 break
action 5 end
action 6 puts "$line"
also, the $line variable contains the "\n" in the end. I would match prefer using string match or regexp action to extract output with 1 line.