Skip to main content

All Questions

Tagged with
0 votes
0 answers
23 views

Linux - How to make grep show the next line too [duplicate]

I am using grep to see a log of one of our systems. When I type "cat server.log | grep PPHI245" it shows the output below: But, when I type just "cat server.log" it shows the output below: Look ...
WitnessTruth's user avatar
1 vote
2 answers
302 views

Filter lines if number of string occurrence found?

Need to filter and show log lines, if line contains exactly 2 commas, and does not contains a specific string. Which linux command need I use, awk, grep, what is the expression? For second condition ...
János's user avatar
  • 271
-1 votes
1 answer
554 views

how to find a particular log from a server for one particular time and zip logs for only that time

I have got a command for the above question. Could anyone please explain me the below command? DATE=`date +%m%d%Y-%H%M%S` ; for i in `ls -lt *.log* | grep "Oct 11" | grep -E '12:|13:|14:' | awk '{...
Smitha's user avatar
  • 1
0 votes
3 answers
193 views

Check which string occurs first in a growing file

I'm running a remote executable which produces a logfile. I want to write a script to check whether the executable is run successfully or encounters an error. The way I can do this is by looking at ...
Eddy's user avatar
  • 3,397
0 votes
3 answers
295 views

Grep for block surrounding an error message

I want to grep for the block of logs around a particular error message. Say I know my log looks like this: [----] I, [2014-04-10T19:12:36.294512 #1910:e93004] INFO -- : Started GET "/ems_infra/new" ...
CHK's user avatar
  • 587
3 votes
4 answers
16k views

How to grep logfile via SSH on multiple servers?

Sometime, I need to find out specific log content(such as api call) from log files, those log files exists in several Linux servers. I have to use SSH to login every server and use grep searching the ...
user avatar