cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1389
Views
0
Helpful
4
Replies

New to EEM

geevee1989
Level 1
Level 1

Hi All,

 

I have recently started learing EEM and it would be a great help if someone can explain the syntax of the below line,

action 1 regexp "Interface ([^,]+)" "$_syslog_msg" match intf

I would like to know:

1.use of regexp

2. How does interface ([^,]+) work

Thanks In advance

Regards,

Geevee

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

The regexp applies a regular expression pattern to a string.  The matched part within parentheses will be stored in the "intf" variable.  The pattern "([^,]+)" says to match one or more of any character other than a comma.  So, "Interface ([^,]+)" will match the literal string "Interface" followed by one or more of any character other than a comma, and store that matched bit after the word "Interface" in the variable "intf".  The string being operated upon in this case is a syslog message (the one that triggered this EEM policy).

Thanks Joseph

Do you have any reference guides where we can learn more about EEM?

regards,

Geevee

This forum is a great place to learn.  Just read through the posts here.  The Cisco.com docs are also good references.  We have a best practices guide at https://supportforums.cisco.com/document/48891/cisco-eem-best-practices that's also worth a read.

Thanks Joseph