[syslog-ng]Syslog.conf translator

Jon Marks j-marks@uiuc.edu
Fri, 4 May 2001 17:31:11 -0500


I've tried out the copy of the awk script syslog2ng incorporated into
the development branch contrib directory-- but it won't run. It's a
parse error that only seems to crop up when awk is fed this program on
its stdin, but not as a command line argument. I'm still not sure why
it doesn't work-- what about its parsing would change using -f? Any
seasoned awk programmers out there want to help out? I'm grateful for
any advice! It's always the same syntactic construct that causes the

        # Handle the various platforms- determine proper log device
        "/bin/uname -s" | getline sysname;      # <-- ERROR HERE!!
        close("/bin/uname -s");


On Wed, May 02, 2001 at 11:47:49AM +0200, Balazs Scheidler wrote:
> On Tue, May 01, 2001 at 06:01:41PM -0500, Jon Marks wrote:
> > Hi,
> > 
> > In order to make the transition to syslog-ng easier for people, I thought
> > it might be useful to have an automated translation from the old
> > syslog.conf to a working syslog-ng.conf. I came up with an awk script
> > which works OK for me. I was targeting Solaris and AIX specifically, but
> > off-hand, RedHat linux syslogd looks the same and I presume other UNIX
> > variants' do, too. Try it, it could work ;)
> > 
> > In particular, there are three things to look out for
> > if you're interested in porting this to another UNIX platform:
> > 
> > 1) Change the local log device if necessary, from /dev/log to whatever
> >    it's supposed to be.
> > 
> > 2) Change the device type (i.e. the syslog-ng.conf directive) for the
> >    local log device. The script checks 'uname' for SunOS and AIX and
> >    sets an appropriate variable; just add to that detection mechanism. 
> >    A variable would do nicely for the log device, too, but they've got
> >    the same name in AIX and Solaris so I didn't worry about it. (I'm not
> >    using the "door" device).
> > 
> > 3) The script is an awk script, but its invoked by ksh. It's easy
> >    to rearrange it so that it's invoked directly as awk, but for what
> >    I plan to do with it, I didn't need that. In either case, ksh won't
> >    be available on many linux distros, I think, so just change the
> >    shell to bash or something. (In this case, I hope the shell you pick
> >    is lenient about newlines within a quoted command line argument!)
> I'd add this script to the contrib subdirectory if you don't mind.
> -- 
> Bazsi
> PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
> _______________________________________________
> syslog-ng maillist  -  syslog-ng@lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng

Jonathan Marks

Systems Administrator, Production Systems Group
Computing and Communication Services Office
University of Illinois at Urbana-Champaign