11-02-2014 09:09 PM
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
11-02-2014 09:57 PM
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).
11-02-2014 10:09 PM
Thanks Joseph
Do you have any reference guides where we can learn more about EEM?
regards,
Geevee
11-02-2014 10:11 PM
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.
11-02-2014 10:20 PM
Thanks Joseph
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide