When we use the option syslog-identifier in the event handler, it does not work.
For Example
service { event-handler { event INTERFACE_STATE { filter { pattern ".*eth0.*" syslog-identifier netplugd } script { path /config/scripts/eventhandler.py } } } }
Messages that trigger this event handler.
Jun 30 13:57:42 vyos dhclient[10266]: DHCPREQUEST for 192.168.17.132 on eth0 to 255.255.255.255 port 67 Jun 30 13:57:42 vyos vyos-event-handler[15519]: Pattern found: ".*eth0.*", script executed: "/config/scripts/eventhandler.py"
The problem exists because of incorrect parsing of the configuration file. In the config file, syslog-identifier is written using a minus symbol, but the event-handler daemon tries to parse it with an underscore.
{ "INTERFACE_STATE": { "filter": { "pattern": ".*eth0.*", "syslog_identifier": "netplugd" }, "script": { "path": "/config/scripts/eventhandler.py" } } }