- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Tail and Grep
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
тАО06-17-2009 07:43 PM
тАО06-17-2009 07:43 PM
Tail and Grep
I was trying to use tail and grep for log monitoring.
Such as this:
tail -f my.log | grep error
It's working in Linux but doesn't seem so in HP-UX 11.23.
Any help?
Thanks,
=adley=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:35 PM
тАО06-17-2009 08:35 PM
Re: Tail and Grep
What is the output you are getting ?
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:36 PM
тАО06-17-2009 08:36 PM
Re: Tail and Grep
>>>>tail -f my.log | grep error
Its working for me on both Linux and HPUX 11.23,11.11.
Anyway tail -f option is ignored when reading from a pipe.
Instead of "-f" option you can put a sleep argument in your script for the desired time.
Cheers!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:41 PM
тАО06-17-2009 08:41 PM
Re: Tail and Grep
What is the difference you are seeing? Can you post both the outputs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:50 PM
тАО06-17-2009 08:50 PM
Re: Tail and Grep
Thanks for the inputs.
The problem is there is no output.
It simply hung after I pressed ENTER (it's been like this for 5 minutes almost) :)
Well, I asked this because I wanted to monitor IPMON logs.
But, I think I'll just reroute the ipmon logs to a separate file instead. :)
Thanks,
=adley=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 09:01 PM
тАО06-17-2009 09:01 PM
Re: Tail and Grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 09:06 PM
тАО06-17-2009 09:06 PM
Re: Tail and Grep
I thought about that.
The thing is, I did try to simulate an error attempt.
For example, if the ipf rule is this:
pass in quick on lan8 proto tcp from 10.192.x.y to any port = NNNN keep state
block in log quick on lan8 proto tcp from any to any port = NNNN keep state
I tried attempting to the same port from, say, 10.192.x.z, I did get rejected by ipf. But no logs of the blocking.
But nevermind, I have re-routed the logs to another file instead of syslog.log; so I can tail there instead easily. :)
Really appreciate everyone's help!
Thanks,
=adley=
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 10:27 PM
тАО06-17-2009 10:27 PM
Re: Tail and Grep
>>tail -f my.log | grep error
will open your my.log and waiting for any line which is having error insert into the my.log file.
if your my.log file will not getting any error string then you will not getting any error.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 11:03 PM
тАО06-17-2009 11:03 PM
Re: Tail and Grep
# echo "error $(date)" >> /tmp/pv
# tail -f /tmp/pv |grep error
error Thu Jun 18 10:00:49 UTC 2009
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 11:37 PM
тАО06-17-2009 11:37 PM
Re: Tail and Grep
perhaps you should try a non-case sensitive search:
# tail -f my.log | grep -i error
regards,
John K.