https://github.com/Cacti/plugin_syslog/issues/218
So maybe I get more luck here.
I try to setup a few filter based on SQL command like that:
Code: Select all
message REGEXP 'LINEPROTO-5-UPDOWN|LINK-3-UPDOWN'
What I want is all message containing one of this 2 messages to be transferred.
When I do so I got the following error messages, and the SQL query related to it:
Code: Select all
01/12/2023 14:50:59 - SYSLOG error mysql1: INSERT INTO `syslog`.`syslog_removed` (logtime, priority_id, facility_id, program_id, host_id, message) SELECT logtime, priority_id, facility_id, host_id, message FROM `syslog`.`syslog` WHERE message REGEXP 'LINEPROTO-5-UPDOWN|LINK-3-UPDOWN'
01/12/2023 14:50:59 - CMDPHP ERROR: A DB Exec Failed!, Error: Column count doesn't match value count at row 1
01/12/2023 14:50:59 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_removal.php[61]:form_actions(), /plugins/syslog/syslog_removal.php[140]:api_syslog_removal_reprocess(), /plugins/syslog/syslog_removal.php[333]:syslog_remove_items(), /plugins/syslog/functions.php[619]:syslog_db_execute(), /plugins/syslog/database.php[69]:db_execute(), /lib/database.php[362]:db_execute_prepared())
01/12/2023 14:50:59 - SYSLOG error mysql: DELETE syslog FROM `syslog`.`syslog` INNER JOIN `syslog`.`syslog_facilities` AS sf ON sf.facility_id = si.facility_id INNER JOIN `syslog`.`syslog_priorities` AS sp ON sp.priority_id = si.priority_id INNER JOIN `syslog`.`syslog_programs` AS spg ON spg.program = si.program INNER JOIN `syslog`.`syslog_hosts` AS sh ON sh.host = si.host WHERE (message REGEXP 'LINEPROTO-5-UPDOWN|LINK-3-UPDOWN')
01/12/2023 14:50:59 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'si.facility_id' in 'on clause'
01/12/2023 14:50:59 - CMDPHP SQL Backtrace: (/plugins/syslog/syslog_removal.php[61]:form_actions(), /plugins/syslog/syslog_removal.php[140]:api_syslog_removal_reprocess(), /plugins/syslog/syslog_removal.php[333]:syslog_remove_items(), /plugins/syslog/functions.php[624]:syslog_db_execute(), /plugins/syslog/database.php[69]:db_execute(), /lib/database.php[362]:db_execute_prepared())
The 'SYSLOG error mysql1' and 'SYSLOG error mysql' is a log I add on function.php line 618 and 623
Maybe I do the SQL command in a bad way, I don't understand the error message on 'SYSLOG error mysql1'
As for the 'SYSLOG error mysql' somehow the table alias si for the facility_id is missing