I was wodering if awk would be a good program to use to pull information from a log file that contains several hosts. Underneath each host in the log there is a description of problem(s) that have occurred while trying to back it up.
example of the log file I have manipulated:
----------------------------------------------------------
host-1
1146692578 1 4 16 uhilh703 177178 177178 0 gardnere-laptop bpsched backup of client host-1 exited with status 1 (the requested operation was partially successful)
host-2
1146690631 1 4 8 uhilh703 177268 177268 0 uhilc304 bpbrm from client host-2: WRN - can't open file: C:\Program Files\Symantec AntiVirus\SAVRT\0057NAV~.TMP (WIN32 32: The process cannot access the file because it is being used by another process. )
host-3
1146690719 1 4 8 uhilh703 177269 177269 0 uhildp27 bpbrm from client host-3: WRN - can't open file: C:\Program Files\Symantec AntiVirus\Savrt\0644NAV~.TMP (WIN32 32: The process cannot access the file because it is being used by another process. )
--------------------------------------------------------
Anyway there are several of these hosts and each one has a system administrator that I want to email their hosts' information from this file. I have a separate file that lists each system administrator's name, e-mail, and host that they are managing.
I was wondering how I can extract each hosts information from the log and send it to its system administrator.
Any ideas would be appreciated! (Just something to get me started with would be great.)
example of the log file I have manipulated:
----------------------------------------------------------
host-1
1146692578 1 4 16 uhilh703 177178 177178 0 gardnere-laptop bpsched backup of client host-1 exited with status 1 (the requested operation was partially successful)
host-2
1146690631 1 4 8 uhilh703 177268 177268 0 uhilc304 bpbrm from client host-2: WRN - can't open file: C:\Program Files\Symantec AntiVirus\SAVRT\0057NAV~.TMP (WIN32 32: The process cannot access the file because it is being used by another process. )
host-3
1146690719 1 4 8 uhilh703 177269 177269 0 uhildp27 bpbrm from client host-3: WRN - can't open file: C:\Program Files\Symantec AntiVirus\Savrt\0644NAV~.TMP (WIN32 32: The process cannot access the file because it is being used by another process. )
--------------------------------------------------------
Anyway there are several of these hosts and each one has a system administrator that I want to email their hosts' information from this file. I have a separate file that lists each system administrator's name, e-mail, and host that they are managing.
I was wondering how I can extract each hosts information from the log and send it to its system administrator.
Any ideas would be appreciated! (Just something to get me started with would be great.)