LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-06-2023, 05:24 PM   #1
bsparks
LQ Newbie
 
Registered: Oct 2017
Posts: 4

Rep: Reputation: Disabled
Setting up conditional forwarder on Centos 8


I have Centos 8 and setting up a conditional forwarder in /etc/rsyslog.conf, which states that "If there is any line with "XY 3890" and contains "trfchk" in /var/log/messages, it should be forwarded to "/var/log/trfchksdblog" -->
Quote:
# trfchksdblog setup
$FileCreateMode 0644 /var/log/trfchksdblog
if $msg contains 'XY 3890' and not ($msg contains 'trfchk1' or $msg contains 'trfchk2' or $msg contains 'trfchk4' or $msg contains 'trfchk5') then /var/log/trfchksdblog
When I am validating the config, it throws below error
Code:
[root@centos81 ~]# rsyslogd -N3
rsyslogd: version 8.24.0-55.el7, config validation run (level 3), master config /etc/rsyslog.conf
rsyslogd: error: extra characters in config line ignored: '/var/log/trfchksdblog' [v8.24.0-55.el7]
[root@centos81 ~]#
I can't figure, what is extra character in this log file. Can someone advice please?
Thanks
--------------
Edit : It is fixed. It was syntax error and now below part is done and good
Code:
# trfchksdblog setup
$FileCreateMode 0644
if $msg contains 'XY 3890' and not ($msg contains 'trfchk1' or $msg contains 'trfchk2' or $msg contains 'trfchk4' or $msg contains 'trfchk5') then /var/log/trfchksdblog

Last edited by bsparks; 12-06-2023 at 06:12 PM. Reason: Fixed syntax and now good
 
  


Reply

Tags
centos, rsyslog



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bind9 - How to set up conditional forwarder for .local domain? roe-dk Linux - Server 1 04-30-2017 03:53 AM
[SOLVED] Linux Bind conditional forwarder based on dst domain dr.x Linux - Server 9 05-08-2015 07:55 AM
Setting up a personal e-mail forwarder izomiac Linux - Server 4 05-19-2012 08:26 PM
Help required to setting forwarder to external mail id on sendmail lokeshreddy4u Linux - Newbie 3 07-02-2008 03:28 AM
setting packet forwarder b123coder Linux - Networking 1 05-05-2005 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration