cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1587
Views
0
Helpful
1
Replies

TCL value $arr_einfo(msg) empty

peraocompany
Level 1
Level 1

Hello i have some test tcl script for cisco router:

# script.tcl test
::cisco::eem::event_register_syslog tag 1 pattern ".*SYS-5-CONFIG_I: Configured from console.*" occurs 1 ::cisco::eem::trigger { ::cisco::eem::correlate event 1 ::cisco::eem::attribute tag 1 occurs 1 } namespace import ::cisco::eem::* namespace import ::cisco::lib::* set hostname [info hostname] array set arr_einfo [event_reqinfo] puts "Syslog message is $arr_einfo(msg)"

i call tcl script: event manager policy script.tcl

event manager directory user policy "flash:/"

in this case I have all time blank cli message: Syslog message is (without arr_einfo(msg))
Can someone help please? Thank you.

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

This variable should not be blank.  However, it may start with a newline, which could give the impression of being blank.  Change your last line to:

puts "Syslog message is **$arr_einfo(msg)**"

And you'll see the asterisks to let you know if the variable is truly empty.