cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1885
Views
0
Helpful
2
Replies

Collect event_reqinfo msg details empty

sotiris.ioannou
Level 1
Level 1

Hi all,

I'm trying to collect the last syslog message that triggered a script to run as shown below:

::cisco::eem::event_register_syslog pattern "%LINEPROTO-5-UPDOWN:" maxrun 120

# NAMESPACE IMPORT

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

array set syslog_info [event_reqinfo]

set message $syslog_info(msg)

action_syslog msg "----------> $message"

But every single time the variable is empty despite the fact the script was triggered.

Output

*Apr 18 13:20:23.511: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down

*Apr 18 13:20:24.019: %HA_EM-6-LOG: duplex-snmp.tcl: ---------->

*Apr 18 13:20:23.511: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down

Any idea why ?

Thanks

Sotiris

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

It's not empty.  The syslog message starts with a newline, so the line right below ---> is the syslog message stored in the $message variable.  If you want to prove that, do:

action_syslog msg "----------> [string trim $message]"

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

It's not empty.  The syslog message starts with a newline, so the line right below ---> is the syslog message stored in the $message variable.  If you want to prove that, do:

action_syslog msg "----------> [string trim $message]"

Thanks Joseph.