Re: Re: Parsing SAR output with PHP.
| From: | DL Neil | Date: | Fri, 11 Jan 2002 11:38:29 +0000 |
| Subject: | Re: Re: Parsing SAR output with PHP. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80187@lists.php.net to get a copy of this message | ||
Or checkout the sql import facilities offered by your choice of database to 'convert' the
data from log to
db-tbl, then set up your analysis in PHP+SQL separately.
=dn
----- Original Message -----
From: "Martin Wickman" <wizball@hotbrev.com>
To: <php-general@lists.php.net>
Sent: 11 January 2002 09:08
Subject: [PHP] Re: Parsing SAR output with PHP.
> Austin Gonyou wrote:
>
> > The real question I suppose is how could I parse this type
> > of output into something I could use to make a graph.
> >
> > Example:
> > 12:20:00 PM CPU %user %nice %system %idle
> > 12:30:00 PM all 2.17 0.79 0.77 96.27
>
>
> > Problem is I'm not sure how to go about breaking up the rows
> > to allow them to be inserted into the db. Thanks in advance for
> > any ideas.
>
> I guess fields are separated with tabs? Then just use split, as in:
>
>
> list($time,$cpu,$ser,$nice,$ststem, $idle)= split ("\t", $line);
>
> Then build your INSERT sql clause. Graph building is then a simple
> matter of passing the data as arrays to your php graph system.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>