Last active
May 5, 2016 12:31
-
-
Save iAugur/4435596 to your computer and use it in GitHub Desktop.
Analysing your Drupal Watchdog for Spammers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get a list of Mollom entries from the Drupal Watchdog | |
* summarised by IP address | |
*/ | |
SELECT hostname, count(wid) | |
FROM `watchdog` | |
where type = 'mollom' and message like 'Spam%' | |
group by hostname | |
order by count(wid) desc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get a summary of Mollom spam events for a given IP by day from the Drupal Watchdog | |
*/ | |
select FROM_UNIXTIME(timestamp, '%Y %M %d'), count(*) | |
from `watchdog` | |
where hostname = '<put an IP in here>' | |
group by FROM_UNIXTIME(timestamp, '%Y %M %d') | |
order by FROM_UNIXTIME(timestamp, '%Y %M %d') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get a summary of Mollom spam events by day from the Drupal Watchdog | |
*/ | |
select DATE_FORMAT(FROM_UNIXTIME(timestamp) , '%Y-%m-%d') as day, count(*) | |
from `watchdog` | |
where message like 'Spam%' | |
group by DATE_FORMAT(FROM_UNIXTIME(timestamp) , '%Y-%m-%d') | |
order by DATE_FORMAT(FROM_UNIXTIME(timestamp) , '%Y-%m-%d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment