Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Help with EEM script

Hi

I am trying to write an EEM script for a failed sip condition so for example when the command show sip-us statistics | i ReqTimeout is run if the values increase I am then going to stop a traffic export and write to flash. The latter works fine.

When you run the command manually you get the following output

ReqTimeout 0/1, Conflict 0/0, Gone 0/0

I am trying to match on the 1 on the 0/1 of the request timeout but cannot get the regexp to match on the 1 it always match the 0, so any advice on the writing the regular expression would be great as I cant seem to figure out how to get the digit after the /.

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Help with EEM script

regexp {ReqTimeout \d+/(\d+)} $output match num

puts $num

Or in applets:

regexp "ReqTimeout [0-9]+/([0-9]+)" $_cli_result match num

puts $num

2 REPLIES
Cisco Employee

Help with EEM script

regexp {ReqTimeout \d+/(\d+)} $output match num

puts $num

Or in applets:

regexp "ReqTimeout [0-9]+/([0-9]+)" $_cli_result match num

puts $num

New Member

Help with EEM script

Thanks Joseph, I take it it matches with the () in the appelet

385
Views
0
Helpful
2
Replies
CreatePlease to create content