- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Monitoring a Log File
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
Discussions
Discussions
Forums
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
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
тАО12-11-2003 05:01 AM
тАО12-11-2003 05:01 AM
I need to monitor at the end of a logfile using a korn script continuously for a particular phrase to occur. Like "Error Occured" then I have to read the whole line and write to another file. Can you guys provide me any help!
Thanks in advance!
Dude70
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:05 AM
тАО12-11-2003 05:05 AM
Re: Monitoring a Log File
Try
tail logfile | grep "error occured" > otherfile
As a start point
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:09 AM
тАО12-11-2003 05:09 AM
Re: Monitoring a Log File
Create a file called monitorlog containing:-
--------------cut-----------------
#!/bin/sh
tail logfile | grep error occured > otherfile
sleep 10
exec monirorlog
----------------cut--------------
this will check the file and write out the error to otherfile, sleep for 10 seconds and then restart itself.
Paula
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:11 AM
тАО12-11-2003 05:11 AM
Re: Monitoring a Log File
I will have to embarass you if I get an email from your system... :-)
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:12 AM
тАО12-11-2003 05:12 AM
Re: Monitoring a Log File
Thing is the log file is dumped with lots of errors some times. I don't want to read the same error again. I want to start from the point where I finished reading before.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:13 AM
тАО12-11-2003 05:13 AM
Re: Monitoring a Log File
look here:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=293706
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:14 AM
тАО12-11-2003 05:14 AM
Re: Monitoring a Log File
I was just giving pointers, you gave the solution.
;^)
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:17 AM
тАО12-11-2003 05:17 AM
Re: Monitoring a Log File
this is the script from the thread from Bryan:
tail -f log.txt | while read LINE
do
echo $LINE | grep "Error Occured" >> log2.txt
done
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2003 05:21 AM
тАО12-11-2003 05:21 AM
Re: Monitoring a Log File
tail -f logfile | grep my_error
tail will keep waiting on the logfile and feed new lines to grep as they occur continuing until you kill the process.
John.