cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1496
Views
0
Helpful
2
Replies

Help with EEM script

simon.thompson
Level 1
Level 1

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

Joe Clarke
Cisco Employee
Cisco Employee

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

puts $num

Or in applets:

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

puts $num

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

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

puts $num

Or in applets:

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

puts $num

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: