Find the answer to your Linux question:
Results 1 to 1 of 1
Hey All - I want to be able to append text to the syslog-ng.conf based on some input from the user.. Basically I'm going to ask for the name of ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    6

    Question Manipulating syslog-ng.conf via script

    Hey All -

    I want to be able to append text to the syslog-ng.conf based on some input from the user.. Basically I'm going to ask for the name of the syslog server and based on that point the syslog-ng.conf to throw all the d_auth information to the syslog server..

    basically change

    destination d_auth { file("/var/log/secure"); };

    to

    destination d_auth { file("/var/log/secure"); udp("servername" port(514); };

    based on a READ variable

    I've checked around about using sed, but I can't find any option to append directly after matching a search string, it just seems to want to append a new line..

    I've found that syslog-ng will support two d_auth lines in the config file, but I'm still interested to know how to do something like this.

    Any help is appreciated..

    Thanks,

    Chris
    Last edited by cmschube; 12-01-2010 at 05:09 PM. Reason: grammar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...