.sample operation to edit logfile to analyze.
Followings are sample to get average JOB elapsed time from JobLog.
Other useful command/option for data manipulation is listed bellow.
Find -j :join lines around the found word,
or join between the found 2 word of "&"(AND) search.
Find -L :set any line command to the found line.
useful in the EXE cmd file.
F *=Mn all:2 file key matching.
REP/CRE/APP x/nx:output to a file from only excluded/not excluded
lines of current file.
SPLit strdelm:split line at the point before/after the string.
JOIn x/nx:join each excluded/not excluded part to a line.
TC FMT :field alignment for use of cut & paste.
for huge file cannot be opened by xe, use xfmt utility.
TC ~ :alive count calculation.
e.g.) count parallel session at each SYN event time
for the line containing SYN & FIN time edited
from TCP/IP trace.
For huge file cannot be opened by xe, use xfmt/xmj
utility to reduce file size by picking-up some required
fields and lines, then join lines by matching key.
EXE :execute multiple sequence of cmd.
useful to apply same sequence of cmd to multiple
files. to create cmd file cmd log file may be useful.
::cl(command log file) is optionally written.
(1) Use "d" line cmd to delete unrelated lines such as header lines.
dd | 5722SS1 V5R2M0 020719 Activity Log
dd | MSGID SEV MSG TYPE
0003| CPF1124 Info JOB 956017 18:25:14 started
0004| 956017 03/08/28 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended. rc=0.
0006| 956017 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started
0008| 956018 03/08/28 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started
0010| 956019 03/08/28 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended. rc=0.
0012| 956018 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended. rc=0.
0014| 956019 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started
0016| 956020 03/08/28 18:25:40.826792
0017| CPI9803 Info JOB 956020 assigned.
0018| 956020 03/08/28 18:25:41.225128
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended. rc=0.
0020| 956020 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started
0022| 956021 03/08/28 18:25:41.836736
0023| CPI9803 Info JOB 956021 assigned.
0024| 956021 03/08/28 18:25:42.236168
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended. rc=0.
0026| 956021 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started
0028| 956022 03/08/28 18:25:43.245872
0029| CPI9803 Info JOB 956022 assigned.
0030| 956022 03/08/28 18:25:43.677712
|
|
v
0003| CPF1124 Info JOB 956017 18:25:14 started
0004| 956017 03/08/28 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended. rc=0.
0006| 956017 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started
0008| 956018 03/08/28 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started
0010| 956019 03/08/28 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended. rc=0.
0012| 956018 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended. rc=0.
0014| 956019 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started
0016| 956020 03/08/28 18:25:40.826792
0017| CPI9803 Info JOB 956020 assigned.
0018| 956020 03/08/28 18:25:41.225128
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended. rc=0.
0020| 956020 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started
0022| 956021 03/08/28 18:25:41.836736
0023| CPI9803 Info JOB 956021 assigned.
0024| 956021 03/08/28 18:25:42.236168
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended. rc=0.
0026| 956021 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started
0028| 956022 03/08/28 18:25:43.245872
0029| CPI9803 Info JOB 956022 assigned.
0030| 956022 03/08/28 18:25:43.677712
(2) Use "j" line cmd to join multiple lines to a line.
specify jj3--jj when record is constructed by 3 lines.
(When record lines are not same between each record type,
extract all lines belong to the record type then join it.
To extract the record lines, exclude all lines by "x all".
Then, for ex., a record is constructed by 5 lines,enter "i CP1164 -a4".
-a4 means display found line and following 4 lines.
After that, extract the record by "del x all" and append to a file
using APPend cmd. repeat that for all record type.)
jj | CPF1124 Info JOB 956017 18:25:14 started
0004| 956017 03/08/28 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended. rc=0.
0006| 956017 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started
0008| 956018 03/08/28 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started
0010| 956019 03/08/28 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended. rc=0.
0012| 956018 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended. rc=0.
0014| 956019 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started
0016| 956020 03/08/28 18:25:40.826792
0017| CPI9803 Info JOB 956020 assigned.
0018| 956020 03/08/28 18:25:41.225128
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended. rc=0.
0020| 956020 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started
0022| 956021 03/08/28 18:25:41.836736
0023| CPI9803 Info JOB 956021 assigned.
0024| 956021 03/08/28 18:25:42.236168
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended. rc=0.
0026| 956021 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started
0028| 956022 03/08/28 18:25:43.245872
0029| CPI9803 Info JOB 956022 assigned.
jj | 956022 03/08/28 18:25:43.677712
|
| (Intermediate column is dropped to include in the page)
v
0003| CPF1124 Info JOB 956017 18:25:14 started ... 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended.... 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started ... 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started ... 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended.... 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended.... 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started ... 18:25:40.826792
0017| CPI9803 Info JOB 956020 assigned. ...1.225128
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended.... 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started ... 18:25:41.836736
0023| CPI9803 Info JOB 956021 assigned. ...2.236168
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended.... 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started ... 18:25:43.245872
0029| CPI9803 Info JOB 956022 assigned. ...3.677712
(3) Use Shift F11 to display column gauge which is used by SORT or TC cmd.
|
| (Intermediate column is dropped to include in the page)
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 18:25:14 started ... 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended.... 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started ... 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started ... 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended.... 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended.... 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started ... 18:25:40.826792
0017| CPI9803 Info JOB 956020 assigned. ...1.225128
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended.... 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started ... 18:25:41.836736
0023| CPI9803 Info JOB 956021 assigned. ...2.236168
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended.... 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started ... 18:25:43.245872
0029| CPI9803 Info JOB 956022 assigned. ...3.677712
(4) exclude lines to be deleted.
cmd input line===>x COI9803 all
|
| (Intermediate column is dropped to include in the page)
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 18:25:14 started ... 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended.... 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started ... 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started ... 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended.... 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended.... 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started ... 18:25:40.826792
- 1 line excluded ----------------------------------------------------------------------
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended.... 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started ... 18:25:41.836736
- 1 line excluded ----------------------------------------------------------------------
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended.... 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started ... 18:25:43.245872
- 1 line excluded ----------------------------------------------------------------------
(5) Delete useless lines.
cmd input line===>del x all
|
| (Intermediate column is dropped to include in the page)
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 18:25:14 started ... 18:25:14.265840
0005| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended.... 03/08/28 18:25:14.555056
0007| CPF1124 Info JOB 956018 18:25:24 started ... 18:25:24.576336
0009| CPF1124 Info JOB 956019 18:25:34 started ... 18:25:34.886520
0011| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended.... 03/08/28 18:25:24.865520
0013| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended.... 03/08/28 18:25:35.195192
0015| CPF1124 Info JOB 956020 18:25:40 started ... 18:25:40.826792
0019| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended.... 03/08/28 18:25:41.794896
0021| CPF1124 Info JOB 956021 18:25:41 started ... 18:25:41.836736
0025| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended.... 03/08/28 18:25:43.195912
0027| CPF1124 Info JOB 956022 18:25:43 started ... 18:25:43.245872
(6) Sort by recordID,in this case that is msgid.
Each record has different msg format, sort to use Cut & Paste.
cmd input line===>sort 2-8
|
| (Intermediate column is dropped to include in the page)
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 18:25:14 started ... 18:25:14.265840
0005| CPF1124 Info JOB 956018 18:25:24 started ... 18:25:24.576336
0006| CPF1124 Info JOB 956019 18:25:34 started ... 18:25:34.886520
0009| CPF1124 Info JOB 956020 18:25:40 started ... 18:25:40.826792
0011| CPF1124 Info JOB 956021 18:25:41 started ... 18:25:41.836736
0013| CPF1124 Info JOB 956022 18:25:43 started ... 18:25:43.245872
0015| CPF1164 Comp 18:25:14 03/08/28 JOB 956017 Ended.... 03/08/28 18:25:14.555056
0019| CPF1164 Comp 18:25:24 03/08/28 JOB 956018 Ended.... 03/08/28 18:25:24.865520
0021| CPF1164 Comp 18:25:35 03/08/28 JOB 956019 Ended.... 03/08/28 18:25:35.195192
0025| CPF1164 Comp 18:25:41 03/08/28 JOB 956020 Ended.... 03/08/28 18:25:41.794896
0027| CPF1164 Comp 18:25:43 03/08/28 JOB 956021 Ended.... 03/08/28 18:25:43.195912
(7) Arrange field of each record to Sort by JOB number.
To arrange use Cut & Paste. If file has many lines, exclude intermediate
lines using "x" line cmd for convenient operation.
Or use shift line cmd such as "(".
When cursor is in the file contents area, shift effect is limited to the
left or right half of the cursor position.
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 started 18:25:14.265840
0005| CPF1124 Info JOB 956018 started 18:25:24.576336
0007| CPF1124 Info JOB 956019 started 18:25:34.886520
0009| CPF1124 Info JOB 956020 started 18:25:40.826792
0011| CPF1124 Info JOB 956021 started 18:25:41.836736
0013| CPF1124 Info JOB 956022 started 18:25:43.245872
0015| CPF1164 Comp JOB 956017 Ended. 18:25:14.555056
0019| CPF1164 Comp JOB 956018 Ended. 18:25:24.865520
0021| CPF1164 Comp JOB 956019 Ended. 18:25:35.195192
0025| CPF1164 Comp JOB 956020 Ended. 18:25:41.794896
0027| CPF1164 Comp JOB 956021 Ended. 18:25:43.195912
(8) Sort by JOB number to construct Job record/
cmd input line===>sort 25-30
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 started 18:25:14.265840
0005| CPF1164 Comp JOB 956017 Ended. 18:25:14.555056
0007| CPF1124 Info JOB 956018 started 18:25:24.576336
0009| CPF1164 Comp JOB 956018 Ended. 18:25:24.865520
0011| CPF1124 Info JOB 956019 started 18:25:34.886520
0013| CPF1164 Comp JOB 956019 Ended. 18:25:35.195192
0015| CPF1124 Info JOB 956020 started 18:25:40.826792
0019| CPF1164 Comp JOB 956020 Ended. 18:25:41.794896
0021| CPF1124 Info JOB 956021 started 18:25:41.836736
0025| CPF1164 Comp JOB 956021 Ended. 18:25:43.195912
0027| CPF1124 Info JOB 956022 started 18:25:43.245872
(9) Join lines to construct job record into a line.
Delete by "d" line cmd the lines dose not construct full record.
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
jj | CPF1124 Info JOB 956017 started 18:25:14.265840
0005| CPF1164 Comp JOB 956017 Ended. 18:25:14.555056
0007| CPF1124 Info JOB 956018 started 18:25:24.576336
0009| CPF1164 Comp JOB 956018 Ended. 18:25:24.865520
0011| CPF1124 Info JOB 956019 started 18:25:34.886520
0013| CPF1164 Comp JOB 956019 Ended. 18:25:35.195192
0015| CPF1124 Info JOB 956020 started 18:25:40.826792
0019| CPF1164 Comp JOB 956020 Ended. 18:25:41.794896
0021| CPF1124 Info JOB 956021 started 18:25:41.836736
jj | CPF1164 Comp JOB 956021 Ended. 18:25:43.195912
d | CPF1124 Info JOB 956022 started 18:25:43.245872
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| CPF1124 Info JOB 956017 started 18:25:14.265840 CPF1164 Comp JOB 956017 Ended. 18:25:14.555056
0007| CPF1124 Info JOB 956018 started 18:25:24.576336 CPF1164 Comp JOB 956018 Ended. 18:25:24.865520
0011| CPF1124 Info JOB 956019 started 18:25:34.886520 CPF1164 Comp JOB 956019 Ended. 18:25:35.195192
0015| CPF1124 Info JOB 956020 started 18:25:40.826792 CPF1164 Comp JOB 956020 Ended. 18:25:41.794896
0021| CPF1124 Info JOB 956021 started 18:25:41.836736 CPF1164 Comp JOB 956021 Ended. 18:25:43.195912
(10) Arrange for TC cmd remaining necessary fields by Cut & Paste.
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| JOB 956017 started 18:25:14.265840 Ended. 18:25:14.555056
0007| JOB 956018 started 18:25:24.576336 Ended. 18:25:24.865520
0011| JOB 956019 started 18:25:34.886520 Ended. 18:25:35.195192
0015| JOB 956020 started 18:25:40.826792 Ended. 18:25:41.794896
0021| JOB 956021 started 18:25:41.836736 Ended. 18:25:43.195912
(11) calculate elapsed time of each job.
cmd input line===>tc 49-63-=23-30
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| JOB 956017 started 18:25:14.265840 Ended. 00:00:00.555056
0007| JOB 956018 started 18:25:24.576336 Ended. 00:00:00.865520
0011| JOB 956019 started 18:25:34.886520 Ended. 00:00:01.195192
0015| JOB 956020 started 18:25:40.826792 Ended. 00:00:01.794896
0021| JOB 956021 started 18:25:41.836736 Ended. 00:00:02.195912
(12) Calculate record count and average, min and max of elapsed time.
cmd input line===>tc 49-63+ amm aft
|
|
v
col |....+....1....+....2....+....3....+....4....+....5....+....6....+....7..
0003| JOB 956017 started 18:25:14.265840 Ended. 00:00:00.555056
0007| JOB 956018 started 18:25:24.576336 Ended. 00:00:00.865520
0011| JOB 956019 started 18:25:34.886520 Ended. 00:00:01.195192
0015| JOB 956020 started 18:25:40.826792 Ended. 00:00:01.794896
0021| JOB 956021 started 18:25:41.836736 Ended. 00:00:02.195912
0022|= =00:00:06.606576; /5=00:00:01.321315; (00:00:00.555056<<00:00:02.195912);