- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help me out on this.!!Find "ERROR" in the log ...
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
тАО01-24-2011 06:16 PM
тАО01-24-2011 06:16 PM
Help me out on this.!!Find "ERROR" in the log file
Help me out on this.!!
Example log file. say file.log
dd-mm-yyyy fsagsgsfgf ERROR:gsdagasfgsdfgaga
I want to know,
how to find the jan 1st 2011 with only ""ERROR" on the above mentioned log file.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 06:26 PM
тАО01-24-2011 06:26 PM
Re: Help me out on this.!!Find "ERROR" in the log file
grep "01-01-2011" filename | grep ERROR
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 06:32 PM
тАО01-24-2011 06:32 PM
Re: Help me out on this.!!Find "ERROR" in the log file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2011 11:28 PM
тАО01-24-2011 11:28 PM
Re: Help me out on this.!!Find "ERROR" in the log file
Similar to the pharoah's way but just a little different.
cat filename | grep -e 1/1/2011 -e ERROR
That should work too. Or you can also try egrep.
Regards
Ismail Azad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 03:40 AM
тАО01-25-2011 03:40 AM
Re: Help me out on this.!!Find "ERROR" in the log file
This isn't similar, this is wrong, it does an OR, the OP wants an AND.
A better solution and without the evil cat:
grep "01-01-2011.*ERROR" filename
- Tags:
- evil cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 04:24 AM
тАО01-25-2011 04:24 AM
Re: Help me out on this.!!Find "ERROR" in the log file
> jan 1st 2011 with only ""ERROR".
Yup more than ERROR, important word there was "only". Was thinking in terms of "OR". Sorry bout that.
Regards
Ismail Azad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 05:16 AM
тАО01-25-2011 05:16 AM
Re: Help me out on this.!!Find "ERROR" in the log file
grep "^01-01-2011" file.log | grep ERROR