Hi, This is a repost of my blog bost at http://bazsi.blogs.balabit.com/, if you have an opinion about the subject please either reply to this e-mail, or post a comment on my blog. ---- I'm about to implement configuration file includes, and although the implementation is quite straightforward, the syntax to be used is something to give a thought or two. Currently the syslog-ng configuration file consists of statements, each with the following basic format: stmt [] { ... }; The "id" gives a unique identifier of the statement, and the braces enclose the contents. Currently only the ID part is optional, the braces are always there. To make the include statement consistent with that, it'd have to look something like: include { "filename" }; Obviously I don't like this too much, as it is way different from all other applications permitting the use of include statements. What about this: include "filename"; E.g. use the ID part the name of the file to be included. I like this better. A third option might be the use of 'pragma' directives, currently only used to specify the file format compatibility in the case of syslog-ng 3.0: @version: 3.0 This'd mean that include statements would look like this: @include: filename The problem with this last option is that pragmas are currently only processed at the beginning of the configuration file. So that code should also be generalized. I think I'd go with the second option, that's not completely inconsistent, but still the most intuitive to use. What do you think? -- Bazsi
Balazs Scheidler wrote:
What about this:
include "filename";
I've been waiting for file includes for a while, and I think that include "filename"; is the cleanest looking. -h -- Hari Sekhon Always open to interesting opportunities http://www.linkedin.com/in/harisekhon
I think that you should stay with the full syslog-by syntax with the {} because you may want to add options to the statement in the next version and the simpified syntax does not allow for options. Perhaps an option of "optional" so that if the file did not exist syslog-by would continue without it. Other options may become apparent over time. Evan Rempel UVic Systems On 10-Dec-08, at 7:29 AM, "Balazs Scheidler" <bazsi@balabit.hu> wrote:
Hi,
This is a repost of my blog bost at http://bazsi.blogs.balabit.com/, if you have an opinion about the subject please either reply to this e-mail, or post a comment on my blog.
----
I'm about to implement configuration file includes, and although the implementation is quite straightforward, the syntax to be used is something to give a thought or two.
Currently the syslog-ng configuration file consists of statements, each with the following basic format:
stmt [] { ... };
The "id" gives a unique identifier of the statement, and the braces enclose the contents. Currently only the ID part is optional, the braces are always there.
To make the include statement consistent with that, it'd have to look something like:
include { "filename" };
Obviously I don't like this too much, as it is way different from all other applications permitting the use of include statements. What about this:
include "filename";
E.g. use the ID part the name of the file to be included. I like this better. A third option might be the use of 'pragma' directives, currently only used to specify the file format compatibility in the case of syslog-ng 3.0:
@version: 3.0
This'd mean that include statements would look like this:
@include: filename
The problem with this last option is that pragmas are currently only processed at the beginning of the configuration file. So that code should also be generalized.
I think I'd go with the second option, that's not completely inconsistent, but still the most intuitive to use.
What do you think?
-- Bazsi
______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
On Wed, 2008-12-10 at 08:24 -0800, Evan Rempel wrote:
I think that you should stay with the full syslog-by syntax with the {} because you may want to add options to the statement in the next version and the simpified syntax does not allow for options.
Perhaps an option of "optional" so that if the file did not exist syslog-by would continue without it. Other options may become apparent over time.
I chose the simpler format for now, I can always add the {} block if the need arises, but I think that assigning options to a simple include operation should not be necessary. The 'optional' feature could be made global, e.g. if the ignore-not-existing-include-files() option is set to yes, then syslog-ng would start up just fine if an include file does not exist. I've pushed the implementation now, but I'm writing about it in a separate email. -- Bazsi
participants (3)
-
Balazs Scheidler
-
Evan Rempel
-
Hari Sekhon