LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-17-2016, 03:45 AM   #1
scryptkiddy
LQ Newbie
 
Registered: Jan 2014
Posts: 20

Rep: Reputation: Disabled
Question Rsyslog and logger test


I'm trying to set up an rsyslog rule so that it logs all auth privilege messages with priority of alert and higher, but its not logging anything. Here is what I changed in /etc/rsyslog.conf:

Code:
...
#commented this out
#authpriv.*     /var/log/secure

#added this
authpriv.alert  /var/log/my_alert_auth.log
...
I then restarted rsyslog
Code:
# systemctl restart rsyslog
I then tested an alert priority log entry with logger:
Code:
# logger -p alert "This is an alert message"

# cat /var/log/my_alert_auth.log 
#

Sure, the test message is set to priority alert, but how do I know its also an authpriv type of message?
I'm a little confused on why logger doesn't have a facility and a priority option. Maybe that's the issue?

SK
 
Old 05-17-2016, 05:25 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
From:
Code:
man logger
-p pri
Enter the message with the specified priority. The priority may be specified numerically or as a "facility.level" pair. For example, "-p local3.info" logs the message(s) as informational level in the local3 facility. The default is "user.notice."
So use this to send to the facility you're testing:

Code:
logger -p authpriv.alert "Your Text Here"
 
1 members found this post helpful.
Old 05-18-2016, 03:44 AM   #3
scryptkiddy
LQ Newbie
 
Registered: Jan 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
You ever have those embarrassing moments where its just funny to imagine how you could have missed something that obvious and clearly written out in the man page which you swore you read a hundred times... lol

Thanks TenTenths for being gentle, lol.

SK
 
Old 05-18-2016, 03:57 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by scryptkiddy View Post
You ever have those embarrassing moments where its just funny to imagine how you could have missed something that obvious and clearly written out in the man page which you swore you read a hundred times... lol
Happens to me on a daily basis!
 
Old 05-18-2016, 05:53 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by TenTenths View Post
Happens to me on a daily basis!
What ^ said.
 
  


Reply



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
Load test, boundary test & stress test for USB EHCI/xHCI driver rama_toshiba Linux - Kernel 5 02-29-2012 02:43 PM
[SOLVED] Silencing the line "echo test > test/test.txt" in a shell script Arenlor Linux - General 2 06-18-2010 01:37 PM
System logger & Kernel logger service start twice? quanta Fedora 0 12-07-2007 06:09 AM
syslog: using logger (please help test this) psychobyte Linux - Security 1 01-07-2005 06:26 PM

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

All times are GMT -5. The time now is 06:19 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