[syslog-ng] Some issues with syntax checking

Pallagi Zoltán pzolee at balabit.hu
Sun Nov 22 00:15:53 CET 2009


Hi Guillaume,

Thank you for your notices they were interesting for me.
Please post a bug about booth problems (you can see the details below)

Guillaume Rousse írta:
> Hello list.
>
> Unresolved object errors seems not to be catched by 'syslog-ng 
> --syntax-only', whereas they are fatal errors. For instance, with this 
> configuration file:
> @version:3.0
>
> log { source(s_foo); destination(d_foo); };
>
> [root at oberkampf guillaume]# syslog-ng --syntax-only
> [root at oberkampf guillaume]# syslog-ng
> Error in configuration, unresolved source reference; source='s_foo'
>   
I guess this is not a real syntax problem it seems to be a logical error 
in config, but you are right the syslog-ng should also check it with 
this option.
> Moreover, the error message is sometimes a bit misleading. with this 
> configuration file:
> @version:3.0
>
> source s_foo { unix-stream ("/dev/log" max-connections(100)); };
> log { source(s_foo); destination(d_foo); };
>
> [root at oberkampf guillaume]# syslog-ng --syntax-only
> [root at oberkampf guillaume]# syslog-ng
> Error in configuration, unresolved destination reference; filter='d_foo'
>
> What is missing is a destination, not a filter.
>   
It seems to be a copy-paste error, this patch fixes it:

pzolee at pzolee-laptop:~/zwa/work/syslog-ng.git$ git diff
diff --git a/src/center.c b/src/center.c
index a606e56..92e49e6 100644
--- a/src/center.c
+++ b/src/center.c
@@ -369,7 +369,7 @@ log_center_init_pipe_line(LogCenter *self, 
LogConnection *conn, GlobalConfig *cf
           if (!ep->ref)
             {
               msg_error("Error in configuration, unresolved destination 
reference",
-                        evt_tag_str("filter", ep->name->str),
+                        evt_tag_str("destination", ep->name->str),
                         NULL);
               return FALSE;
             }




More information about the syslog-ng mailing list