thinkshout / drupal-project

:rocket: Composer template for Drupal projects. Quick installation via "composer create-project thinkshout/drupal-project"
5 stars 1 forks source link

Dumb 404s in watchdog, begone! #71

Closed bdimaggio closed 4 years ago

bdimaggio commented 4 years ago

Turns out Pantheon provides a way to reject certain requests at the nginx level, rather than invoking Drupal. I'd like to bounce the following very common paths from all our Drupal installs:

Got this list by some mysql fiddling on local copies of some of our biggest D7 and D8 sites, which I'll dump here in case anyone wants to do the same research on more sites:

select SUM(num_found), path FROM
((select count(wid) as num_found, TRIM(BOTH '"' FROM REGEXP_SUBSTR(variables, '"/[^"]+"')) as path from freedomhouse_develop.watchdog where type='page not found' group by path) UNION
(select count(wid) as num_found, TRIM(BOTH '"' FROM REGEXP_SUBSTR(variables, '"/[^"]+"')) as path from lvhn_develop.watchdog where type='page not found' group by path) UNION
(select count(wid) as num_found, TRIM(BOTH '"' FROM REGEXP_SUBSTR(variables, '"/[^"]+"')) as path from demos_develop.watchdog where type='page not found' group by path) UNION 
(select count(wid) as num_found, CONCAT('/', message) as path from icaboston.watchdog where type="page not found" group by path) UNION
(select count(wid) as num_found, CONCAT('/', message) as path from splc.watchdog where type="page not found" group by path) UNION
(select count(wid) as num_found, CONCAT('/', message) as path from eqex.watchdog where type="page not found" group by path) UNION
(select count(wid) as num_found, CONCAT('/', message) as path from fhao.watchdog where type="page not found" group by path)) as t1 
GROUP BY path
order by num_found desc;
mariacha commented 4 years ago

Nice -- love it!