@@ -44,6 +44,35 @@ static const char *const log_format_table[_SYSLOG_TRANSMISSION_LOG_FORMAT_MAX] =
4444
4545DEFINE_STRING_TABLE_LOOKUP (log_format , int );
4646
47+ static const char * const syslog_facility_table [_SYSLOG_FACILITY_MAX ] = {
48+ [SYSLOG_FACILITY_KERN ] = "kern" ,
49+ [SYSLOG_FACILITY_USER ] = "user" ,
50+ [SYSLOG_FACILITY_MAIL ] = "mail" ,
51+ [SYSLOG_FACILITY_DAEMON ] = "daemon" ,
52+ [SYSLOG_FACILITY_AUTH ] = "auth" ,
53+ [SYSLOG_FACILITY_SYSLOG ] = "syslog" ,
54+ [SYSLOG_FACILITY_LPR ] = "lpr" ,
55+ [SYSLOG_FACILITY_NEWS ] = "news" ,
56+ [SYSLOG_FACILITY_UUCP ] = "uucp" ,
57+ [SYSLOG_FACILITY_CRON ] = "cron" ,
58+ [SYSLOG_FACILITY_AUTHPRIV ] = "authpriv" ,
59+ [SYSLOG_FACILITY_FTP ] = "ftp" ,
60+ [SYSLOG_FACILITY_NTP ] = "ntp" ,
61+ [SYSLOG_FACILITY_SECURITY ] = "security" ,
62+ [SYSLOG_FACILITY_CONSOLE ] = "console" ,
63+ [SYSLOG_FACILITY_SOLARIS_CRON ] = "solaris-cron" ,
64+ [SYSLOG_FACILITY_LOCAL0 ] = "local0" ,
65+ [SYSLOG_FACILITY_LOCAL1 ] = "local1" ,
66+ [SYSLOG_FACILITY_LOCAL2 ] = "local2" ,
67+ [SYSLOG_FACILITY_LOCAL3 ] = "local3" ,
68+ [SYSLOG_FACILITY_LOCAL4 ] = "local4" ,
69+ [SYSLOG_FACILITY_LOCAL5 ] = "local5" ,
70+ [SYSLOG_FACILITY_LOCAL6 ] = "local6" ,
71+ [SYSLOG_FACILITY_LOCAL7 ] = "local7" ,
72+ };
73+
74+ DEFINE_STRING_TABLE_LOOKUP (syslog_facility , int );
75+
4776typedef struct ParseFieldVec {
4877 const char * field ;
4978 size_t field_len ;
@@ -180,6 +209,10 @@ static int manager_read_journal_input(Manager *m) {
180209 r = safe_atou (facility , & fac );
181210 if (r < 0 )
182211 log_debug ("Failed to parse syslog facility: %s" , facility );
212+ else if (fac < _SYSLOG_FACILITY_MAX && ((UINT32_C (1 ) << fac ) & m -> excluded_syslog_facilities )) {
213+ log_debug ("Skipping message with excluded facility %s." , syslog_facility_to_string (fac ));
214+ return 0 ;
215+ }
183216
184217 if (fac >= LOG_NFACILITIES )
185218 fac = JOURNAL_DEFAULT_FACILITY ;
0 commit comments