getting stats from drupal watchdog

alan dawson's picture
|

here are some simple examples of some SQL to get information from watchdog, using sql string matching...

SELECT message,timestamp FROM watchdog WHERE message LIKE '%daws%' 
AND type='user' AND message NOT LIKE 'notify%';

you get the idea...
to see how many password resets I'd asked for I'd do

SELECT hostname,message,timestamp FROM watchdog 
WHERE message LIKE '%Password%' and type='user' 
AND message LIKE '%ligh%';

or

SELECT COUNT(*) FROM watchdog 
WHERE message LIKE '%Password%' and type='user' AND MESSAGE LIKE '%dawson%';