[syslog-ng] Localport() & localip() cause syntax error

Evan Rempel erempel at uvic.ca
Thu Mar 29 23:23:14 CEST 2007


simonst at wellsfargo.com wrote:
> My syslog-ng (2.0.2) client works fine with a tcp destination: 
> 
> 	destination centralLog { tcp("10.11.12.13" port(5432); 
>                                    template("$UNIXTIME $HOST $MESSAGE\n");
> ); };
> 
> but gets a syntax error when I add localip() and localport():
> 
> 	destination centralLog { tcp("10.11.12.13" port(5432); 
>                                    localip(10.9.8.7) localport(5432);
>                                    template("$UNIXTIME $HOST $MESSAGE\n");
> ); };

The basic syntax of the line is wrong in terms of brackets and semicolons

destination centralLog { tcp("10.11.12.13" port(5432) localip(10.9.8.7) localport(5432) template("$UNIXTIME $HOST 
$MESSAGE\n"); };

A single *network* destination is all done within one set of ();
and multiple of these can be in one destination spec

destination centralLog { tcp(...); tcp(...); tcp(...); };

where the ... contains all of the options/settings for the single *network* destination.

Evan.

> 
> I've tried various combinations of localip() & localport(), and also
> semicolons.  
> Can anyone see what's wrong?
> 
> 
> Here's the entire syslog-ng.conf:
> 
> options { long_hostnames(off); sync(0); };
> source src { unix-stream("/dev/log"); internal(); };
> source kernsrc { file("/proc/kmsg"); };
> destination messages {
>    file("/var/log/messages.$MON$DAY"
>    owner(root) group(abcde) perm(0644));
>    };
> destination centralLog  { tcp("10.11.12.13"  port(5432) localip("10.9.8.7");
> localport(5432);
>                                          template("$UNIXTIME $HOST
> $MESSAGE\n"); ); };
> destination centralLog2 { tcp("10.21.22.23"  port(5432) localip("10.9.8.7")
> localport(5432)
>                                          template("$UNIXTIME $HOST
> $MESSAGE\n") ); };
> log { source(src); source(kernsrc); destination(centralLog);
> destination(centralLog2);
>                                     destination(messages); };
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> syslog-ng maillist  -  syslog-ng at lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Frequently asked questions at http://www.campin.net/syslog-ng/faq.html
> 


-- 
Evan Rempel                erempel at uvic.ca
Senior Programmer Analyst        250.721.7691
Computing Services
University of Victoria


More information about the syslog-ng mailing list