- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Syslog.log reporting
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2003 09:50 PM
04-12-2003 09:50 PM
I need to write a shell scripts to do reporting on those all events that happen yesterday and logged in syslog.log file. I also need to include in the scripts an exclusion list for those events that I am not interested on. Can someone advice on a workable shell scripting techniuqes other than using grep -v which is going to be a lot when it come to exclusion.
I have to use shell script and not Perl or any other lang.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2003 11:33 PM
04-12-2003 11:33 PM
Solutionhttp://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2003 08:18 PM
04-13-2003 08:18 PM
Re: Syslog.log reporting
#!/bin/sh
FILE="/var/adm/syslog/syslog.log"
EXP="-e registrar -e ftp -e telnet -e omni -e ident"
grep -v $EXP $FILE > /var/adm/syslog/syslog-filtered.log
You can also pipe a grep looking for a specific date:
DATE=`date %b %e`
grep "$DATE" /var/adm/syslog/syslog.log
If you havethe space, you can keep a copy of your syslog.log file from each run, and just grep the diff of the old and current files:
diff /var/adm/syslog/syslog.log /var/adm/syslog/oldsyslog.log > /tmp/syslog.diff
grep -v $EXP /tmp/syslog.diff
You can install the GNU shell utilities from
http://hpux.connect.org.uk/hppd/hpux/Gnu/sh_utils-2.0/
This package includes the GNU date command, which allows you to specify the date you want to display, instead of just the curretn date and time. This makes it easier to search for date strings from 24 hours ago.
I hope this is some help. Please follow-up if you have more specific questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 05:11 AM
04-15-2003 05:11 AM
Re: Syslog.log reporting
Then I would sort by unique or count them or whatever is appropriate.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2003 05:52 AM
04-15-2003 05:52 AM
Re: Syslog.log reporting
try
for field in "last message" DTSESSION
do
grep "$field" /var/adm/syslog/syslog.log
done|sort
replace list of fields with the ones you want
only extract needed and no -v
Steve Steel