Need single table output from 2 sar command outputs
sar -r | awk '{print $1, $2, $5, $10}' -- output table 1 --
sar -f | awk '{pritn $4, $6, $4+$6}' -- output table 2 I need to join two tables output into single table, How? Regards mohdkmn |
Can you show some example outputs and what you want the result to look like, using code tags https://www.linuxquestions.org/quest...do=bbcode#code
|
Dear Chris,
Thanks for your reply.. The output of sar -r | awk '{print $1, $2, $5, $10}' is, 12:00:01 AM %memused %swpused 12:10:01 AM 99.25 25.99 12:20:01 AM 99.26 25.99 12:30:01 AM 99.29 25.99 12:40:01 AM 99.26 25.99 12:50:02 AM 99.22 25.99 01:00:01 AM 99.27 25.99 The output of sar -f | awk '{pritn $4, $6, $4+$6}' is, %user %system 0.79 0.59 1.38 0.74 0.58 1.32 0.72 0.59 1.31 0.79 0.61 1.4 0.79 0.61 1.4 0.72 0.58 1.3 0.78 0.61 1.39 0.81 0.63 1.44 I need a below output Time %memused %swapused %user %system %CPU 12:10:01 AM 99.25 25.99 0.79 0.59 1.38 12:20:01 AM 99.26 25.99 0.74 0.58 1.32 12:30:01 AM 99.29 25.99 0.72 0.59 1.31 Thanks for Advance .. |
Both files need a common field (likely the time stamp). Without that, there is nothing to connect the record from the second file to the record of the first file.
Then you can use the "join" command to combine records. |
Not knowing the sar command, if you supply both switches on a single call will all the raw data be there to create the complete table? If so you would need to show the output from that command.
|
All times are GMT -5. The time now is 08:52 PM. |