From ArchWiki
Revision as of 20:30, 2 July 2012 by Karol (Talk | contribs) (Example configuration file is outdated: re)

Jump to: navigation, search

after the example syslog-ng.conf, and aside from the timestamps and remote loghost tips, most of this article has been adapted from the gentoo wiki page for syslog-ng.conf .. FYI

So yes it needs updating for arch please

AskApache 22:19, 14 September 2010 (EDT)

Is match() example right?

The example:

 filter f_failed { match("regex" value("failed")); };

is in my opinion bad.

List of supported values in value() should be: "HOST", "HOST_FROM", "MESSAGE", "PROGRAM", "PID", "MSGID" and "SOURCE".

More info:

Better example could be:

 filter f_grsecurity { match("^grsec" value("MESSAGE")); };

This is real/working example from my syslog-ng config.

Tojaj 16:39, 8 February 2011 (EST)

Reversal typo in Shorewall examples

The example:

 filter f_shorewall { not match("regex" value("Shorewall")); };                  # Filter everything except regex keyword Shorewall
 filter f_noshorewall { match("regex" value("Shorewall")); };                    # Filter regex keyword Shorewall

I believe the identifiers are switched. I have switched them to what I think they are intended to be. nuclearsandwich 14:58, 26 February 2011 (PST)

Directly to SQL

I notice that we still aren't running syslog-ng with --enable-sql (should be a trivial change at some point) but thought I would populate some basic options that will work well in the wiki when available.

This config is only valid for 3.2 and up (Current as of this writing in Arch is

Taken directly from

@version: 3.2
source s_file{file("/var/log/inputfile*.log" follow-freq(1));};
destination d_sql {
    columns("insert_time int", "date_time varchar(32)", "facility int", "priority int", "host varchar(255)", "program varchar(64)", "pid int", "message varchar(4000)")
    values("${R_UNIXTIME}", "${S_YEAR}-${S_MONTH}-${S_DAY} ${S_HOUR}:${S_MIN}:${S_SEC}", "$FACILITY_NUM", "$LEVEL_NUM", "$HOST", "$PROGRAM", "${PID:-0}", "$MSGONLY")
    indexes("insert_time", "date_time", "facility", "host", "program")
  source (s_file);
  destination (d_sql);

- Provided by HRabbit (2012-04-26)

Example configuration file is outdated

The used /etc/syslog-ng/syslog-ng.conf file is outdated. It generates these errors when restarting syslog-ng:

$ sudo rc.d restart syslog-ng
:: Stopping Syslog-NG                                                    [DONE] 
:: Starting Syslog-NG                                                    [BUSY] 

WARNING: Configuration file format is too old, please update it to use the 3.3 format as some constructs might operate inefficiently;
WARNING: global: the default value of log_fifo_size() has changed to 10000 in version 3.3 to reflect log_iw_size() changes for tcp()/udp() window size changes;
Error parsing config, syntax error, unexpected KW_LOG in /etc/syslog-ng/syslog-ng.conf at line 30, column 10:


syslog-ng documentation:
mailing list:

Foppe (talk) 01:04, 2 July 2012 (UTC)

I'm using syslog-ng 3.3.5-1 and I get no warnings.
For solving such issues, I think forums, IRC or the arch-general mailing list is better than the wiki. - Karol (talk) 08:59, 2 July 2012 (UTC)
Thanks for your response.
I'm not searching for answes to my problems but merely warning the Wiki article might to be out of date. For starters the @version tag in line 1 should read
@version: major.minor
and reflect the current version of syslog-ng used in Arch. I haven't investigated the error I got but probably the original author of this section could have a look.
Foppe (talk) 19:00, 2 July 2012 (UTC)
I may have misunderstood you. If you're referring to the Example configuration file then yes, it is outdated as the current version is 3.3. I think we should replace it with a link to the current one. What do you think? -- Karol (talk) 20:30, 2 July 2012 (UTC)