]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/syslog: Refactor syslog definitions
authorJeff Lucovsky <jeff@lucovsky.org>
Sat, 15 May 2021 14:13:59 +0000 (10:13 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 20 Sep 2021 15:31:15 +0000 (17:31 +0200)
src/alert-syslog.c
src/output-eve-syslog.c
src/output-json.c
src/util-syslog.h

index ecc731d76702597f2bee2e79d0d8544f8dad6beb..6307d982d67726509757aeb876d30904cc07796f 100644 (file)
@@ -52,9 +52,6 @@
 
 #ifndef OS_WIN32
 
-#define DEFAULT_ALERT_SYSLOG_FACILITY_STR       "local0"
-#define DEFAULT_ALERT_SYSLOG_FACILITY           LOG_LOCAL0
-#define DEFAULT_ALERT_SYSLOG_LEVEL              LOG_ERR
 #define MODULE_NAME                             "AlertSyslog"
 
 static int alert_syslog_level = DEFAULT_ALERT_SYSLOG_LEVEL;
index 1501fe095900f41d283e7a522b17f19deb2d0ac5..5e47fb3cb94f5b34db8b980c9ed60036b54d5b01 100644 (file)
 #include "output-eve-syslog.h"
 #include "util-syslog.h"
 
-#define DEFAULT_ALERT_SYSLOG_FACILITY_STR "local0"
-#define DEFAULT_ALERT_SYSLOG_FACILITY     LOG_LOCAL0
-#define DEFAULT_ALERT_SYSLOG_LEVEL        LOG_INFO
-
 #ifdef OS_WIN32
 void SyslogInitialize(void)
 {
@@ -113,8 +109,5 @@ void SyslogInitialize(void)
     plugin_data->Init = SyslogInit;
     plugin_data->Deinit = SyslogDeInit;
     plugin_data->Write = SyslogWrite;
-    if (!SCRegisterEveFileType(plugin_data)) {
-        FatalError(SC_ERR_PLUGIN, "Failed to register EVE output: %s", OUTPUT_NAME);
-    }
 }
 #endif /* !OS_WIN32 */
index 20672a72aa4c1e7c4b53d187e1b93f9c709ca93c..d3571f0afe9d0b22bb6e1f07c5a66ac08a8a1612 100644 (file)
@@ -71,9 +71,6 @@
 #include "suricata-plugin.h"
 
 #define DEFAULT_LOG_FILENAME "eve.json"
-#define DEFAULT_ALERT_SYSLOG_FACILITY_STR       "local0"
-#define DEFAULT_ALERT_SYSLOG_FACILITY           LOG_LOCAL0
-#define DEFAULT_ALERT_SYSLOG_LEVEL              LOG_INFO
 #define MODULE_NAME "OutputJSON"
 
 #define MAX_JSON_SIZE 2048
index 0efc1c5db7837656abdbabfb99542aa3d62b6f5e..ebbc8478c0d564949cf8445c5561ed3c0f8dbe5f 100644 (file)
 SCEnumCharMap *SCSyslogGetFacilityMap(void);
 SCEnumCharMap *SCSyslogGetLogLevelMap(void);
 
+#ifndef OS_WIN32
+#define DEFAULT_ALERT_SYSLOG_FACILITY_STR "local0"
+#define DEFAULT_ALERT_SYSLOG_FACILITY     LOG_LOCAL0
+#define DEFAULT_ALERT_SYSLOG_LEVEL        LOG_ERR
+#endif
+
 #endif /* UTIL_SYSLOG_H */