Page 1 of 1

searching log files

Posted: 15 Jan 2019 06:40
by joejames_786
hi

someone pl help me.

I have a log file SERVER_ERROR.log which contain 100000 or more lines

i need a script that should read a file named SERVER_LIST.txt
which contain 2 columns of data ie.......

1 2

XX BACKUP
BX STORAGE
JX DATA
RE CARD
FD CUSTOMER
HH SERVER
....and so (around 100 servers)

the script should search the SERVER_ERROR.log file for occurrences of each server ID (column 1) and write it to a text file named
SORTED_ERROR_LOG.txt


ie....

XX BACKUP = 200
BX STORAGE = 12
JX DATA = 123
RE CARD = 220

..... and so on

please help me

thanx in advance

Re: searching log files

Posted: 16 Jan 2019 16:28
by aGerman
joejames_786 wrote:
15 Jan 2019 06:40
XX BACKUP = 200
What is the 200 for? The number lines found in the log file that begin with XX BACKUP?
What does "columns" mean? Are XX and BACKUP separated by a various number of spaces or always by the same number?

Steffen

Re: searching log files

Posted: 16 Jan 2019 18:53
by joejames_786
hi

1.the 2 columns are seperated by a single tab space


2. the number 200 is possible number of lines in the SERVER_ERROR.LOG file.

3. only the "ID" ie....(XX BX JX RE) is written in the SERVER_ERROR.log and not the server name