2011-10-14 04:05:01 procs memory page faults cpu r b w avm free re at pi po fr de sr in sy cs us sy id 2 0 0 535206 3325748 0 0 0 0 0 0 0 2043 5411 125 0 5 95 4 0 0 535206 3324971 0 0 0 0 0 0 0 3810 2980 234 0 6 94 2011-10-14 04:06:01 procs memory page faults cpu r b w avm free re at pi po fr de sr in sy cs us sy id 2 0 0 535206 3324971 0 0 0 0 0 0 0 2043 8413 224 0 5 95 4 0 0 597237 3325993 0 0 0 0 0 0 0 3354 2695 373 1 5 94 2011-10-14 04:07:01 procs memory page faults cpu r b w avm free re at pi po fr de sr in sy cs us sy id 2 0 0 535206 3324971 0 0 0 0 0 0 0 2043 2423 133 0 5 95 4 0 0 597237 3325993 0 0 0 0 0 0 0 9983 5675 124 1 6 93
こういう vmstat の出力結果を、
$ perl -nle '$.==3 and print qq/ date $_/;/^([\d\-]+ [\d:]+)/ and $.>1 and print qq/$d $l/;/^([\d\-]+ [\d:]+)/ and $d=$1;$l=$_' vmstat.log date r b w avm free re at pi po fr de sr in sy cs us sy id 2011-10-14 04:05:01 4 0 0 535206 3324971 0 0 0 0 0 0 0 3810 2980 234 0 6 94 2011-10-14 04:06:01 4 0 0 597237 3325993 0 0 0 0 0 0 0 3354 2695 373 1 5 94