<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding time stamp to vmstat output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276711#M657602</link>
    <description>&amp;gt;But I want the date on the same line as the data, and I don't need the (AM SAST) string.&lt;BR /&gt;&lt;BR /&gt;Then you may want this format: system("date +\"%x %T\"")&lt;BR /&gt;03/17/11 00:49:02&lt;BR /&gt;&lt;BR /&gt;So:&lt;BR /&gt;vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}'&lt;BR /&gt;&lt;BR /&gt;Or you can just give up on handling the two lines in awk and then use sed(1) to join the two lines:&lt;BR /&gt;vmstat 1 | awk '{system("date +\"%x %T\"");print $0;}' | sed -n -e 'N; s/\^J/ /; p'&lt;BR /&gt;&lt;BR /&gt;Where you enter that control-J by control-V then control-J.</description>
    <pubDate>Thu, 17 Mar 2011 07:08:10 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-03-17T07:08:10Z</dc:date>
    <item>
      <title>Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276701#M657592</link>
      <description>Hi All!&lt;BR /&gt;&lt;BR /&gt;I am trying to add time stamp on vmstat output, but it is not working at all. Here is what I do:&lt;BR /&gt;&lt;BR /&gt;vmstat 1 | awk '{now=strftime("%Y-%m-%d %T "); print now $0}'&lt;BR /&gt;&lt;BR /&gt;but it returns the following:&lt;BR /&gt;&lt;BR /&gt;%Y-%m-%d %T  kthr      memory            page            disk          faults      cpu&lt;BR /&gt;%Y-%m-%d %T  r b w   swap  free  re  mf pi po fr de sr m1 m1 m1 m2   in   sy   cs us sy id&lt;BR /&gt;%Y-%m-%d %T  1 3 0 27153136 1215512 1558 16803 82 158 163 0 152 0 0 0 5 6852 93219 21292 38 26 36&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please can you help&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Tue, 15 Mar 2011 11:22:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276701#M657592</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-15T11:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276702#M657593</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You need to use GNU's 'awk' to avail yourself of 'strftime' in 'awk'.&lt;BR /&gt;&lt;BR /&gt;However, you can do the same thing with Perl:&lt;BR /&gt;&lt;BR /&gt;# perl -MPOSIX -nle 'print join " ",strftime("%Y-%m-%d %T",localtime),$_'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Mar 2011 12:29:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276702#M657593</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-15T12:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276703#M657594</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;vmstat 1 | awk '{system("echo $(date +\"%x %r %Z\")");print $0;}'</description>
      <pubDate>Tue, 15 Mar 2011 15:41:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276703#M657594</guid>
      <dc:creator>Kenan Erdey</dc:creator>
      <dc:date>2011-03-15T15:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276704#M657595</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Kenan&lt;BR /&gt;&lt;BR /&gt;Your command does work fine, but it does not put th date on the same line of the data.&lt;BR /&gt;Would it be possible to make like this:&lt;BR /&gt;&lt;BR /&gt;03/16/11 08:24:42 r     b     w      avm    free   re   at    pi   po    fr   de    sr     in     sy    cs  us sy id&lt;BR /&gt;&lt;BR /&gt;03/16/11 08:24:42 1     1     0    58501  1423937    0    0     0    0     0    0     0    957   2988    36   0  0 100&lt;BR /&gt;&lt;BR /&gt;03/16/11 08:24:43 1     1     0    58501  1424018    0    0     9    0     0    0     0   1002   6107    73   0  1 99&lt;BR /&gt;&lt;BR /&gt;The other query is, if I want to use awk to select/show only values of r, b, sr, us and sy how would I do?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another point. that command it does not work in solaris 10.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2011 05:33:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276704#M657595</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-16T05:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276705#M657596</link>
      <description>&lt;P&gt;&amp;gt;it does not put the date on the same line of the data.&lt;BR /&gt;&lt;BR /&gt;Any reason you use echo within system?&lt;BR /&gt;system("date +\"%x %r %Z\"")&lt;BR /&gt;&lt;BR /&gt;If this doesn't work, you may have to use that echo \c trick I used in this thread:&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/Languages-and-Scripting/AWK-script/m-p/5271240#M41496" target="_blank"&gt;http://h30499.www3.hp.com/t5/Languages-and-Scripting/AWK-script/m-p/5271240#M41496&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2011 17:49:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276705#M657596</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-04T17:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276706#M657597</link>
      <description>&amp;gt;if I want to use awk to select/show only values of r, b, sr, us and sy how would I do?&lt;BR /&gt;&lt;BR /&gt;Instead of printing $0, print the specific columns:&lt;BR /&gt;...; print $1, $2, $12, $16, $17</description>
      <pubDate>Wed, 16 Mar 2011 07:37:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276706#M657597</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-16T07:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276707#M657598</link>
      <description>Hi &lt;BR /&gt;Dennis!&lt;BR /&gt;&lt;BR /&gt;No particulÃ§ar reason to use echo, but I have modified to suit your suggestion, and it came up with:&lt;BR /&gt;&lt;BR /&gt;prep03[151]/ #vmstat 1 | awk '{system("date +\"%x %r %Z\"");print $0;}'&lt;BR /&gt;03/16/11 11:07:17 AM SAST&lt;BR /&gt;         procs           memory                   page                              faults       cpu&lt;BR /&gt;03/16/11 11:07:17 AM SAST&lt;BR /&gt;    r     b     w      avm    free   re   at    pi   po    fr   de    sr     in     sy    cs  us sy id&lt;BR /&gt;03/16/11 11:07:17 AM SAST&lt;BR /&gt;    1     0     0    47263  1437359    0    0     0    0     0    0     0    957   2991    36   0  0 100&lt;BR /&gt;03/16/11 11:07:18 AM SAST&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But I want the date on the same line as the data, and I dont need the (AM SAST) string.&lt;BR /&gt;I know I can use print $1 for selected columns, but how to put it toghether in one line or statement.&lt;BR /&gt;&lt;BR /&gt;I want to use this as an input to gnuplot to produce a graph.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2011 08:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276707#M657598</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-16T08:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276708#M657599</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;how about the date at the end :)&lt;BR /&gt;&lt;BR /&gt;vmstat 1 | awk '{system("echo $(date +\"%x %r \")");printf("%s ",$0);}'</description>
      <pubDate>Wed, 16 Mar 2011 09:13:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276708#M657599</guid>
      <dc:creator>Kenan Erdey</dc:creator>
      <dc:date>2011-03-16T09:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276709#M657600</link>
      <description>&lt;!--!*#--&gt;I've prefaced output from myprocess with a date/time stamp by &lt;BR /&gt;&lt;BR /&gt;myprocess |awk 'BEGIN {"date +%Y%m%d_%H:%M" | getline now} {printf "%s   %s\n", now, $0}' &amp;gt;&amp;gt; $logfile</description>
      <pubDate>Wed, 16 Mar 2011 11:59:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276709#M657600</guid>
      <dc:creator>Jim Fraser</dc:creator>
      <dc:date>2011-03-16T11:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276710#M657601</link>
      <description>&amp;gt;I want the date on the same line as the data, and I don't need the (AM SAST) string.&lt;BR /&gt;&lt;BR /&gt;Then you need to use that alternate solution in the URL I gave.&lt;BR /&gt;&lt;BR /&gt;system("X=$(date +\"%x %r %Z\"); echo $X\\\c")&lt;BR /&gt;&lt;BR /&gt;To change the date format, you need to look at the options under date(1).  I.e. remove %Z, etc.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;how to put it together in one line or statement?&lt;BR /&gt;&lt;BR /&gt;Jim's getline trick may work except you need to get it once per line.</description>
      <pubDate>Wed, 16 Mar 2011 19:01:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276710#M657601</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-16T19:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276711#M657602</link>
      <description>&amp;gt;But I want the date on the same line as the data, and I don't need the (AM SAST) string.&lt;BR /&gt;&lt;BR /&gt;Then you may want this format: system("date +\"%x %T\"")&lt;BR /&gt;03/17/11 00:49:02&lt;BR /&gt;&lt;BR /&gt;So:&lt;BR /&gt;vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}'&lt;BR /&gt;&lt;BR /&gt;Or you can just give up on handling the two lines in awk and then use sed(1) to join the two lines:&lt;BR /&gt;vmstat 1 | awk '{system("date +\"%x %T\"");print $0;}' | sed -n -e 'N; s/\^J/ /; p'&lt;BR /&gt;&lt;BR /&gt;Where you enter that control-J by control-V then control-J.</description>
      <pubDate>Thu, 17 Mar 2011 07:08:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276711#M657602</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-17T07:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276712#M657603</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;Dennis!&lt;BR /&gt;&lt;BR /&gt;Your suggestion:vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}' work perfectely.&lt;BR /&gt;&lt;BR /&gt;But, now I just want the vmstat to shown only  $1, $2, $12, $20 and $21, your suggestion, i.e.&lt;BR /&gt;vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Mar 2011 09:36:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276712#M657603</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-17T09:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276713#M657604</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; But, now I just want the vmstat to shown only $1, $2, $12, $20 and $21&lt;BR /&gt;&lt;BR /&gt;This is AWK-101.&lt;BR /&gt;&lt;BR /&gt;Change '$0' (which is the whole line buffer) to:&lt;BR /&gt;&lt;BR /&gt;$1,$2,$12,$20,$21&lt;BR /&gt;&lt;BR /&gt;The comma (',') will be substitute by the the output field separator, which by default is a space.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Mar 2011 11:51:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276713#M657604</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-17T11:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276714#M657605</link>
      <description>&lt;P&gt;&amp;gt;Your suggestion: vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}' work perfectly.&lt;BR /&gt;&lt;BR /&gt;If you are happy with the answers you were given, please read the following about assigning points:&lt;BR /&gt;&lt;A href="http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos" target="_blank"&gt;http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;gt;now I just want the vmstat to shown only $1, $2, $12, $20 and $21, your suggestion, i.e.&lt;BR /&gt;vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $0}'&lt;BR /&gt;&lt;BR /&gt;As JRF said, just replace that $0 by: $1, $2, $12, $20, $21&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: $1,$2,$12,$20,$21&lt;BR /&gt;&lt;BR /&gt;(I use a space above for readability.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;ME: awk '{system("date +\"%x %T\"");print $0;}' | sed -n -e 'N; s/\^J/ /; p'&lt;BR /&gt;&amp;gt;Where you enter that control-J by ...&lt;BR /&gt;&lt;BR /&gt;I spent a long time figuring this out and today I also needed to join pairs of lines.&lt;BR /&gt;I couldn't type ^J in vi, only the shell.&lt;BR /&gt;Then I just tried using "\n" and it magically worked. Too much overthinking. :-(&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2011 17:48:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276714#M657605</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-08-04T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276715#M657606</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Dennis&lt;BR /&gt;&lt;BR /&gt;I always assign points to you guys, the $1,... $21 did not work, but I am fine with $0, I can always extract the colums that I want to create a graph.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Fri, 18 Mar 2011 06:42:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276715#M657606</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-18T06:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276716#M657607</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; the $1,... $21 did not work&lt;BR /&gt;&lt;BR /&gt;Exactly what did you do and exactly what was the result?&lt;BR /&gt;&lt;BR /&gt;Simply saying "it didn't work" provides no useful information from which to help you further.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 18 Mar 2011 11:53:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276716#M657607</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-18T11:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276717#M657608</link>
      <description>&lt;BR /&gt;Hi&lt;BR /&gt;&lt;BR /&gt;James:&lt;BR /&gt;&lt;BR /&gt;This is the result:&lt;BR /&gt;prep03[140]/ #vmstat 1 | awk '{system("X=$(date +\"%x %T\"); echo $X\\\c");print $1,$2,$12,$20,$21}'&lt;BR /&gt;03/18/11 17:09:34procs memory&lt;BR /&gt;03/18/11 17:09:34r b sr&lt;BR /&gt;03/18/11 17:09:341 1 0&lt;BR /&gt;03/18/11 17:09:351 0 0&lt;BR /&gt;03/18/11 17:09:361 0 0&lt;BR /&gt;03/18/11 17:09:371 0 0&lt;BR /&gt;03/18/11 17:09:381 0 0&lt;BR /&gt;03/18/11 17:09:391 0 0&lt;BR /&gt;03/18/11 17:09:401 0 0&lt;BR /&gt;03/18/11 17:09:411 0 0&lt;BR /&gt;prep03[141]/ #&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There is no space between seconds and r column, and also does not show the last 2 columns that are "us" and "sy"&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Fri, 18 Mar 2011 14:06:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276717#M657608</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-18T14:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276718#M657609</link>
      <description>&amp;gt;There is no space between seconds and r column&lt;BR /&gt;&lt;BR /&gt;Oops, add a space at the end of the date(1) format or one in the echo or one in print:&lt;BR /&gt;vmstat 1 | awk '{system("X=$(date +\"%x %T \"); echo $X\\\c");print $1,$2,$12,$20,$21}'&lt;BR /&gt;&lt;BR /&gt;&amp;gt;does not show the last 2 columns that are "us" and "sy"&lt;BR /&gt;&lt;BR /&gt;You need to use the original values I gave:&lt;BR /&gt;..; print $1, $2, $12, $16, $17&lt;BR /&gt;&lt;BR /&gt;It seems your first reply and the second have different columns?</description>
      <pubDate>Fri, 18 Mar 2011 18:32:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276718#M657609</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-18T18:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding time stamp to vmstat output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276719#M657610</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Dennis:&lt;BR /&gt;Your suggestion worked perfectely, I have already assign points.&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Mon, 21 Mar 2011 13:51:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-time-stamp-to-vmstat-output/m-p/5276719#M657610</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-21T13:51:40Z</dc:date>
    </item>
  </channel>
</rss>

