Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

New to EEM

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
Cisco Employee

The regexp applies a regular

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).

Community Member

Thanks JosephDo you have any

Thanks Joseph

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

regards,

Geevee

Cisco Employee

This forum is a great place

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.

Community Member

Thanks Joseph

Thanks Joseph

247
Views
0
Helpful
4
Replies
CreatePlease to create content