Re: [PHP] log tailing

2012-07-02 Thread Matijn Woudt
On Mon, Jul 2, 2012 at 3:23 PM, Mihamina Rakotomandimby wrote: > On 06/30/2012 09:32 PM, Daniel Brown wrote: >>> >>> >> $ssh_entries = explode(PHP_EOL,trim(`tail /var/log/syslog | awk >>> {'print $1,$2,$3 "|" $5 "|" $11'}`)); > > > This will tail a default number of lines. > > I'm looking for a wa

Re: [PHP] log tailing

2012-07-02 Thread Mihamina Rakotomandimby
On 06/30/2012 09:32 PM, Daniel Brown wrote: This will tail a default number of lines. I'm looking for a way to identify the last line, and when launching the PHP script I get the added line between now and that last one. There is a "logtail" utility in the "logtool" package, but I want a fu

Fwd: Re: [PHP] log tailing

2012-06-30 Thread tamouse mailing lists
-- Forwarded message -- From: "tamouse mailing lists" Date: Jun 30, 2012 4:35 PM Subject: Re: [PHP] log tailing To: "Daniel Brown" On Jun 30, 2012 1:34 PM, "Daniel Brown" wrote: > > On Sat, Jun 30, 2012 at 2:30 PM, Daniel Brown wrote: &

Re: [PHP] log tailing

2012-06-30 Thread Daniel Brown
On Sat, Jun 30, 2012 at 2:30 PM, Daniel Brown wrote: > > > $ssh_entries = explode(PHP_EOL,trim(`tail /var/log/syslog | awk > {'print $1,$2,$3 "|" $5 "|" $11'}`)); Actually, the above was intended to grab just sshd entries, so instead of 'tail' you should use 'grep sshd' in the line above.

Re: [PHP] log tailing

2012-06-30 Thread Daniel Brown
On Fri, Jun 29, 2012 at 4:49 AM, Mihamina Rakotomandimby wrote: [snip!] > > Typically, a log line like: > Jun 29 11:24:10 dev5 sshd[12775]: Accepted password \ >            for dev5 from 192.168.0.12 port 50544 ssh2 > [snip!] > So that I can: > > INSERT INTO ssh_activity \ >   VALUES ('2012-06-29

Re: [PHP] log tailing

2012-06-29 Thread tamouse mailing lists
On Fri, Jun 29, 2012 at 3:49 AM, Mihamina Rakotomandimby wrote: > I have a /var/log/messages and /var/log/syslog file to parse to extract > information from. > > I have the to extract the date, and some information in the line. [snip] > I just need help on the right regexp function to use. > Would