[PHP] log tailing

2012-06-29 Thread Mihamina Rakotomandimby

Hi all,

I have a /var/log/messages and /var/log/syslog file to parse to extract 
information from.


It's mainly to insert the data to several SQL tables.

I have the to extract the date, and some information in the line.

Doing it with preg_match() and extracting the data is the first solution 
comming to my mind.


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

should drive me to extract to $out[] like:
- $out[0]  is "Jun 29 11:24:10"
- $out[1]  is  "sshd"
- $out[3]  is  "192.168.0.12"

So that I can:

INSERT INTO ssh_activity \
   VALUES ('2012-06-29 11:24:10', '192.168.0.12')

I just need help on the right regexp function to use.
Would you know some PHP/regexp tutorials for that?

--
RMA.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php batch/queue framwork

2012-06-29 Thread Tom Sparks
>Forwarded Message: php-general_318334.ezm
>Re: php batch/queue framwork
>Friday, 29 June, 2012 6:30 AM
>From:
>"Shailesh N. Humbad" 
>To:
>php-general@lists.php.net
>On 6/28/2012 11:58 AM, Tom Sparks wrote:
> I am looking for a batch/queue framework that is database-centric?
> I could write my own, but I want one that is mature
>
> tom_a_sparks
> "It's a nerdy thing I like to do"
>
>
>You could try Amazon Simple Queue Service: http://aws.amazon.com/sqs/
>Use the PHP SDK: http://aws.amazon.com/sdkforphp/

I was hoping for something that I could run local on my host

tom

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What's happened to our newsgroup?

2012-06-29 Thread Marc Guay
> You mean everyone finally RTFM?

There's a manual?  GoDaddy told me to just ask all of my questions here!


(No insult meant, in case it's not obvious.)

Happy Fridays
Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 you know some PHP/regexp tutorials for that?

The best documentation I've ever found on Regexes is O'Reilly's
"Mastering Regular Expressions" (3rd ed is 2006, but REs haven't
changed since then).



Only problem is it is hella expensive. (Well another problem is it is
hella big: >500 pages.)

Apart from that, there are *tons* of tutorials on the net. Just google
up "regular expression tutorials" and you should see pages and pages
of them.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php