I was wondering if it is possible to put the output of a syslog message generated from a TCL script into variable and trim that to only get a subset of the syslog message.
I believe the logic would be like this but still trying to translate it to EEM:
set a (show log | incl % IVR)
set b (string a 4555)
# we only want 4555 from the syslog message
And then put b into a CLI command.
Is that possible? Or do I need to write to a file instead and parse the file for that message and put it into the variable?
Thank you in advance for any suggestions.
You need to remove the applet entirely. It has no use on EEM < 3.0. The Tcl policy replaces the whole thing.
Modify the Tcl script so that it runs the desired CLI commands.
Then, you need to decide configure your EEM policy directory. This is the directory in which sl_ivr_runner.tcl exists on the device (e.g. flash:/policies). The command to add is:
event manager directory user policy DIRECTORY
Where DIRECTORY is your policy directory.
Once all of those steps are done, then the policy will work just like the applet does.
No. You will need to convert to Tcl on any platform not running EEM 3.0 (i.e. < 12.4(22)T). Here is a rough Tcl version.
Okay, cool. Then everything you want can be done in applets given that you are running EEM 3.0:
event manager applet UserDefinedDivert
event syslog pattern "%IVR-2-APP_CRIT: 90"
action 001 regexp ": ([0-9]+)" $_syslog_msg ignore pnum
action 002 syslog msg "Phone number is $pnum"
action 003 cli command "enable"
action 004 cli command "do something with $pnum"