Hi,
I urgently need some help how to extract distinct entries from a Log file.
The Log File may have same error occuring many times so how do i count the occurance of an error in file and also extract out distinct errors in a file.
Eg:-
I have a file name A.log
it contains entries as below:-
Error 1
Error 2
Error 1
Error 1
Error 2
#Create your working file, if this isn't a running logfile you can skip this step and just pipe the output from sort on A.log the next step.
cp A.log A.log.tmp
#Sort for unique values and grep on your common Error text
sort A.log.tmp | uniq | grep "Error" >> my_unique_errors.log