I've just started using awk and I really could use some help. I have a log file that is constantly getting appended to every night and the output looks something like this;
/29/03 01:54:01 nsrd: /dev/rmt/4ubn Eject operation in progress
05/29/03 01:54:10 nsrd: /dev/rmt/1ubn Mount operation in progress
05/29/03 01:54:22 nsrd: media event cleared: confirmed mount of NTBelz.033 on /dev/rmt/1ubn
05/29/03 01:54:28 nsrd: media notice: dlt7000 tape bak2.NTmfs3.065 on /dev/rmt/7ubn is full
05/29/03 01:54:29 nsrd: media notice: dlt7000 tape bak2.NTmfs3.065 used 50 GB of 35 GB capacity
05/29/03 01:54:45 nsrd: media info: loading volume bak2.NT.C.502 into /dev/rmt/4ubn
5/06/03 06:23:03 nsrd: media event cleared: confirmed mount of bak2.NTmfs4.010 on /dev/rmt/1ubn
05/06/03 06:30:08 nsrd: media notice: dlt7000 tape bak2.NTmfs3.C.062 on /dev/rmt/2ubn is full
05/06/03 06:30:08 nsrd: media notice: dlt7000 tape bak2.NTmfs3.C.062 used 49 GB of 35 GB capacity
05/06/03 06:30:24 nsrd: media info: verification of volume "bak2.NTmfs3.C.062", volid 2931725057 succeeded.
05/06/03 06:30:40 nsrd: write completion notice: Writing to volume bak2.NTmfs3.C.062 complete
05/06/03 23:58:12 nsrd: media notice: dlt7000 tape MSEXCH.376 on /dev/rmt/0ubn is full
05/06/03 23:58:12 nsrd: media notice: dlt7000 tape MSEXCH.376 used 41 GB of 35 GB capacity
05/06/03 23:59:13 nsrd: media info: verification of volume "MSEXCH.376", volid 2818370561 succeeded.
05/06/03 23:59:27 nsrd: write completion notice: Writing to volume MSEXCH.376 complete
I need the script to read this log file and find any line that contains "is full" and has today's date. Once I have those lines I need to get $8 (eg: bak2.NTmfs3.C.062, MSEXCH.376, bak2.NTmfs3.065) field and only save the field name that contains "NTmfs3" with no "C". So from this example I want the field "bak2.NTmfs2.065" to be saved into a filename for later use and I need this file appended with any other field it finds that meets the criteria.
Any help would be greatly appreciated.
/29/03 01:54:01 nsrd: /dev/rmt/4ubn Eject operation in progress
05/29/03 01:54:10 nsrd: /dev/rmt/1ubn Mount operation in progress
05/29/03 01:54:22 nsrd: media event cleared: confirmed mount of NTBelz.033 on /dev/rmt/1ubn
05/29/03 01:54:28 nsrd: media notice: dlt7000 tape bak2.NTmfs3.065 on /dev/rmt/7ubn is full
05/29/03 01:54:29 nsrd: media notice: dlt7000 tape bak2.NTmfs3.065 used 50 GB of 35 GB capacity
05/29/03 01:54:45 nsrd: media info: loading volume bak2.NT.C.502 into /dev/rmt/4ubn
5/06/03 06:23:03 nsrd: media event cleared: confirmed mount of bak2.NTmfs4.010 on /dev/rmt/1ubn
05/06/03 06:30:08 nsrd: media notice: dlt7000 tape bak2.NTmfs3.C.062 on /dev/rmt/2ubn is full
05/06/03 06:30:08 nsrd: media notice: dlt7000 tape bak2.NTmfs3.C.062 used 49 GB of 35 GB capacity
05/06/03 06:30:24 nsrd: media info: verification of volume "bak2.NTmfs3.C.062", volid 2931725057 succeeded.
05/06/03 06:30:40 nsrd: write completion notice: Writing to volume bak2.NTmfs3.C.062 complete
05/06/03 23:58:12 nsrd: media notice: dlt7000 tape MSEXCH.376 on /dev/rmt/0ubn is full
05/06/03 23:58:12 nsrd: media notice: dlt7000 tape MSEXCH.376 used 41 GB of 35 GB capacity
05/06/03 23:59:13 nsrd: media info: verification of volume "MSEXCH.376", volid 2818370561 succeeded.
05/06/03 23:59:27 nsrd: write completion notice: Writing to volume MSEXCH.376 complete
I need the script to read this log file and find any line that contains "is full" and has today's date. Once I have those lines I need to get $8 (eg: bak2.NTmfs3.C.062, MSEXCH.376, bak2.NTmfs3.065) field and only save the field name that contains "NTmfs3" with no "C". So from this example I want the field "bak2.NTmfs2.065" to be saved into a filename for later use and I need this file appended with any other field it finds that meets the criteria.
Any help would be greatly appreciated.