Operating System - HP-UX
1838598 Members
4203 Online
110128 Solutions
New Discussion

Script for not to see any line on syslog

 
SOLVED
Go to solution
Utpal Krishna
Advisor

Script for not to see any line on syslog

Hi
Can anyone tell me any script with what I don't want to see any particular line "Session closed" in my syslog which comes every frequently


Utpal
To know the best on HP-UX
9 REPLIES 9
Bill Hassell
Honored Contributor
Solution

Re: Script for not to see any line on syslog

grep -v -i "session closed" /var/adm/syslog/syslog.log

You might want to add other filters by using -e as in:

grep -v -i -e "session closed" -e anonymous login" -e "accepted password" /var/adm/syslog/syslog.log


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Script for not to see any line on syslog

cat /var/adm/syslog/syslog.log | grep -v Session

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Utpal Krishna
Advisor

Re: Script for not to see any line on syslog

Hi
thanks for your mail.

But my question was not to see session closed rather to see see session closed. with your command I can on Session closed but I don't want to see that.
Thanks
To know the best on HP-UX
Thayanidhi
Honored Contributor

Re: Script for not to see any line on syslog

Hi,

check the man page ftpd.

ftpd -l makes the log in syslog.log

You may disable -l option ftpd in "/etc/inetd.conf" file and restart ftpd.

Then you will never know some one used the ftp on the server.

TT
Attitude (not aptitude) determines altitude.
Utpal Krishna
Advisor

Re: Script for not to see any line on syslog

Thanks for the reply that will close down(Hide)totally the FTP from the syslog but I don't want to do that I want a script P to appear on syslog but when I will run that script FTP session closed will not be seen.
Can anyone tellme the script regarding that

Thanks
Utpal
To know the best on HP-UX
T G Manikandan
Honored Contributor

Re: Script for not to see any line on syslog

Bill has provided the right way
grep -v -i "session closed" /var/adm/syslog/syslog.log
will not take up the session closed messages from syslog.

Please explain what you want in detail!!
Madhu Sudhan_1
Respected Contributor

Re: Script for not to see any line on syslog

Utpal,
If you don't want to log messages session closed then go with above update. Otherwise use

grep -i "session closed" /var/adm/syslog/syslog.log

-Madhu
Think Positive
Thayanidhi
Honored Contributor

Re: Script for not to see any line on syslog

Hi,

If I understand you correctly, you want
ftpd to log the login information but don't want log "session closed" to syslog.

I don't think it's possible. I checked man page of ftpd.

Either you can enable logging by -l option or disable.
It's not possible to partially omit the log information.

Best way is create new syslog.new file extracted from current syslog and
use this file for your use.

# cd /var/adm/syslog
# grep -v "session closed" syslog.log > syslog.new

Regards

TT
Attitude (not aptitude) determines altitude.
Utpal Krishna
Advisor

Re: Script for not to see any line on syslog

Thank you all for nice reply.
My purpose is solved.

Utpal
To know the best on HP-UX