Is this iostat pipe to sort service request command correct?

Hi,

my os is SLES 10

from sort

iostat

as my output does not include rkB/s and wkB/s I probably have to adjust the key position, so

is the following iostat pipe to sort service request command correct?


oracle@vmc_stallite:~> iostat -x | sort -nrk11
sda               0.96     9.56    1.72    4.21    93.06   112.05    34.57     0.22   36.95   3.66   2.17
Linux 2.6.16.60-0.85.1-default (vmc_stallite)   02/11/14
Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.50    0.06    1.60    0.93    0.00   94.91

thanks a lot!

This should provide a less confusing output (assuming you want to sort the output by the service time):

iostat -x | awk '$13 > 0' | sort -nrk13
iostat -x | awk 'NF>10' | sort -k11r

could you expalin why it is

iostat -x | awk '$13 > 0' | sort -nrk13

why is it 13 and not 11 since my output only have 11 columns?

thanks

Because I overlook you were using an older Linux release which has 12 columns by the way, it should be 11 indeed in your case.

This is what I got (two extra columns r_await and w_await):

sda              72,86    34,47  129,62   19,70  3738,62   450,36    56,11     2,53   16,90   11,26   54,04   1,07  15,92
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util