Jump to content

Any Unix Admin..need Some Help


Recommended Posts

Posted

Bhayya i need some help

 

I have a log file name (X.log). In this X log there were four batch process running lets suppose take it as A,B,C,D.

 

For batch process A - i know start time and end time - B/w these times i need to grab some errors popping up.. The errors would indicate as 'Typo Error'.

 

Note- Only typo errors should be grabbed

 

Note : All A, B, C, D would be running in same log file

 

Similarly i have to do it for B,C and D also

 

Plz help me...Deeniki emyna script raayaalaa

Posted

What is log time format? 

 

paste some lines here, I'll try to give exact syntax to capture 

Posted

What is log time format? 

 

paste some lines here, I'll try to give exact syntax to capture 

 

Bhayya its like lm123456.log (log file)

time format - Start time 2014:05:01 00:00:05

End time -2014:05:01 08:45:45

'error vachi - 'typo error'

 

awk [2014:05:01 00:00:05 - 2014:05:01 08:45:45] | grep typo error lm123456.log

 

elaga chesthey vastundhaa

 

Naku correct ga teliyadhu..ma frnd ki kavali anadu so naku elaga chepadu...naku unix scripting radhu andukey eakda post chesa evaryna answers isthey cchala helpful
 

Posted

Bhayya eddho examples icha anthey..evi actual format kadhuu

Posted
sed -n '/Apr 01 00:00:05/ , /Apr 01 08:45:45/p' lm123456.log | grep "typo error"

you can also use below format for sed

 

sed -n '/2014-3-06 11:34:48/,/2014-3-06 16:34:48/p'

Posted
sed -n '/Apr 01 00:00:05/ , /Apr 01 08:45:45/p' lm123456.log | grep "typo error"

you can also use below format for sed

 

sed -n '/2014-3-06 11:34:48/,/2014-3-06 16:34:48/p'

 

 

ila command ishtey then we can get the errors from aa particualar time period for batch process A na...
 

Posted
sed -n '/Apr 01 00:00:05/ , /Apr 01 08:45:45/p' lm123456.log | grep "typo error"

you can also use below format for sed

 

sed -n '/2014-3-06 11:34:48/,/2014-3-06 16:34:48/p'

 

 

sed - used to get al the data b/w time stamps aa

What is /p is for?

 

bhayya telsukundamani adugutunna

Posted

ila command ishtey then we can get the errors from aa particualar time period for batch process A na...
 

 

same log antunnav kabatti ala command isthe aa particular time lo "typo error" ane strings vasthai. It doesn't depend on A or B or C or D process.

 

If time period is different for other process, it will become little complex

Posted

sed -n '/2014:05:06 00:04:45/ , /2014:05:06 08:35:45/p' lm 123456.log | grep -i typo error ela rasthey work out avtundhi anamataa...

Posted

sed -n '/2014:05:06 00:04:45/ , /2014:05:06 08:35:45/p' lm 123456.log | grep -i typo error ela rasthey work out avtundhi anamataa...

 

use double quotes for string because it has space "type error"

×
×
  • Create New...