On Mon, Jun 21, 2010 at 10:40 PM, Rainer Gerhards
<[email protected]>wrote:

> Hi all,
>
> thanks again for the good feedback. Please keep it flowing, I guess we will
> hit a first milestone very soon. Then, I think, we have a format that we
> could work towards and begin to look at some details.
>
> I have now condensed the comments and thought about them. Then, I have
> looked
> at some ways how config files could actually look like. What then hit me
> was
> that we are very close to how XML looks. For example we had:
>
> <input name=inp10515 type=imtcp>
>        listen 10514
>        ruleset remote10514
> </input>
>
> this almost looks like XML (which is no surprise given the fact that
> Apache's
> config also looks somewhat like XML and we talked about modifications that
> are a bit more in the spirit of XML). The step towards full XML is not a
> big
> one (intentionally formated close to non-XML example):
>
> <input name=inp10515 type=imtcp>
>        <params listen="10514"
>                  ruleset="remote10514"
>                  />
> </input>
>
> While I am not a big fan of XML config files, I have to admit that the
> difference between what we discussed, at least in a later stage, and XML is
> slim. Seeing this, I begin to think that using an XML-based config language
> has a number of advantages. Probably the most important being that I do not
> need to write an maintain a dedicated parser but could use a XML-Parser
> instead. Plus a validating editor could probably be a good aid in writing
> config files (assuming that I get the DTD right, something I have no
> experience in ;)).
>
> So I have converted my original proposal (NOT the last discussion state)
> into
> XML format. Again, I think the XML version is quite readable. Please have a
> look
>
> Original: http://www.rsyslog.com/download/new_rsyslog.conf
> XML: http://www.rsyslog.com/download/xml_rsyslog.conf
>
> I wonder if there is any good argument AGAINST using XML as "described" in
> the sample. If nobody brings up a good argument, I'll very possibly will
> try
> to take the XML road and begin to look what that takes in detail. Of
> course,
> it would be helpful as well if you could make yourself heard if you like
> XML
> format ;).


XML might be better than some apache-like format because:
 - editors will automatically do syntax-highlighting, which greatly improves
readability. If you add <?xml version="1.0"?> as the first line of
xml_rsyslog.conf then editors will notice it's XML, despite the unusual
extension (I've tested vim, emacs and gedit). Editor support also gives you
nice things like auto-intending (=G in vim) and folding.
 - there are some fantastic XML validation languages - see
http://www.relaxng.org and http://www.dsdl.org. Fancy editors will
autocomplete based on the contents of these validation files.
 - XML is natively unicode with a well-defined means of setting the
encoding, and parsers will handle all that for you.

Just wondering, is it necessary to have all those 'params' elements? Could
this:

<input type="imtcp"><params listen="10515" ruleset="remote10515" /> </input>

just become:

<input type="imtcp" listen="10515" ruleset="remote10515" />


Overall though, after the initial curve I've come to quite like the old
format :) A good format is one that is optimized for common cases. For
syslog that is simple statements like:

mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log

which becomes very verbose under XML:

<ruleset id="default">
  <rule>
    <filter pri="mail.*"/>
    <action type="omfile">
      <params file="/var/log/mail.log" sync="false"/>
    </action>
  </rule>
  <rule>
    <filter pri="user.*"/>
    <action type="omfile">
      <params file="/var/log/user.log" sync="false"/>
    </action>
  </rule>
</ruleset>

Anyway, if you do go the XML route I don't think the work would ever be
wasted. An XML DOM is generic enough to act as an AST for any future
formats. Anyone wanting a different format (eg. YAML or Sieve-like) can
simply generate the XML DOM and pass it in.


Jeff


> I am looking forward to your feedback!
>
> Thanks again,
> Rainer
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com
>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to