Can't grep for warning in log file


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Can't grep for warning in log file
# 1  
Old 03-30-2019
Can't grep for warning in log file

Hi

Can't see what I am doing wrong here:

Trying to view a log file and grep for WARNING but keep getting the following error:
Code:
[casupport@docvlapph005 ca]$ view datasource.log | grep WARN
Vim: Warning: Output is not to a terminal
WARNING: JMX not enabled. To enable, specify rmi-client-port and rmi-registry-port
WARNING: Peer 1 (supportlinux3/192.168.200.6:15011) heartbeat failed to get returned in time. Closing the peer connection.
WARNING: Peer 1 (supportlinux3/192.168.200.6:15011) heartbeat failed to get returned in time. Closing the peer connection.

Obliviously I am getting the return but the output is not terminal and then it freezes. Any particular reason why?
# 2  
Old 03-30-2019
Dont use view... use cat instead...
but you could also:
Code:
 grep "WARNING: " datasource.log

These 2 Users Gave Thanks to vbe For This Post:
# 3  
Old 03-30-2019
Thanks Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies

2. Shell Programming and Scripting

How to grep a log file for words listed in separate text file?

Hello, I want to grep a log ("server.log") for words in a separate file ("white-list.txt") and generate a separate log file containing each line that uses a word from the "white-list.txt" file. Putting that in bullet points: Search through "server.log" for lines that contain any word... (15 Replies)
Discussion started by: nbsparks
15 Replies

3. Shell Programming and Scripting

need help in Grep a string in the log file

logfile="/var/tmp.log" output=$(grep "ERROR" $logfile) if then echo "exceptions logged , please check /var/tmp.log for more details" |\ mail -s "exceptions logged , please check /var/tmp.log on for more details" $DL else echo "not found" fi Somehow its not working as... (5 Replies)
Discussion started by: ajothi
5 Replies

4. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

5. Shell Programming and Scripting

Daily grep on a log file

Hi, I would like to execute a daily grep like: grep 2010-09-06 statistics.log|grep API > /var/tmp/stat20100906_sp.txt On date e.g. 2010-09-07 run a grep on yesterday's date, from the result grep the word "API" put all in /var/tmp Would like to have a script configured in the crontab, running... (4 Replies)
Discussion started by: pointer
4 Replies

6. Shell Programming and Scripting

grep active log file

Hi Gurus, I am facing a problem with grepping a set of data in active log file which are the info not in uniform, below is the sample data information. I am trying to grep value. Connect_PM Connect to APPS gateway failed ERROR connection to host anyserver.com, service 6600 timed out ... (4 Replies)
Discussion started by: anakiar
4 Replies

7. Shell Programming and Scripting

Grep: Copy all lines from log file into new file

Hello everyone. I have a log file that contains multiple domains: www.thisdomain.com agent.thisdomain.com that.thisdomain.com I need to copy all of the lines that contain "www.thisdomain.com" from the log and output them into a new file. I've tried everything with little luck. Please help... (3 Replies)
Discussion started by: aberli
3 Replies

8. Shell Programming and Scripting

how to grep for a word in a log file..

Hi All, I have a log file which is storing a backup time stamps information in it. (pasted below) 20081006210008 0 20081006211910 20081006222824 0 20081006224758 20081007210049 0 ... (2 Replies)
Discussion started by: suri.tyson
2 Replies

9. UNIX for Dummies Questions & Answers

Grep Log file

Okay, I got a log file, and I need to use a combo of the tail -f command and the grep command, but I don't want to see all the output, other than what I'm "grepping". As well I'd like it to stop tailing and searching and just return to the command line, once it finds 1 line with that string in it.... (1 Reply)
Discussion started by: cbo0485
1 Replies

10. Shell Programming and Scripting

how to grep for string in log file

Hi Im running a backup scriptwhich creates a log file how do grep for the string in the logfile so the backup script can continue to next stage otherwise it will exit i.e 12:32:53 INF - Client completed sending data for backup 12:33:02 INF - Backup by root on client lonbob04bak using... (4 Replies)
Discussion started by: eb222
4 Replies
Login or Register to Ask a Question