How do I remove wrongly logged page views?

After a website update, we got wrong logging of page urls:
host.domain/undefinedfunction search() { [native code] }

I understand I can unvalidate reports, then re calculate them by reading logs. But I’m missing how do I remove that “url” from logs.

Anyone? Any help is appreciated. Thank you in advance

Well, I managed to do this query but looks like very expensive :expressionless:
Am I going to the right direction?

SELECT idsite, bb.name, server_time FROM piwik.piwik_log_link_visit_action as aa
JOIN piwik.piwik_log_action as bb
ON aa.idaction_url = bb.idaction
WHERE bb.name LIKE '%search(%'
ORDER BY server_time DESC
LIMIT 50
;

Hi Tassoman,

it’s the right way. Matomo wrote, that a function like this is projected, but … nothing.

First
Use mysql query SELECT and find all this wrong Urls. Notice the database table name and maybe also the entries.

Find the connections to this database table. Databases used the ID from the one table in other tables for connect datas. With a mysql query JOIN it is possible to display all the connected data. Find it with mysql query SELECT.

Mysql Joins: https://www.w3schools.com/mysql/mysql_join.asp
Maybe a Triple Join is needed.

Maybe download the database tables with the raw data (logs) and use a text editor for a search.

log_action
log_conversion
log_conversion_item
log_link_visit_action
log_profiling
log_visit

mysqldump -u username -pPassword -h host.example.com database_name table_name > YYYYMMDD-database_name-table_name.sql

-pPassword without whitespace.

Second
You must decide what you needed, ass well as what is correct:

Use mysql query DELETE to delete all the database table rows that are connected with the wrong URL entries.
And/Or
Use mysql query UPDATE to empty the database table cell data in the selected rows.

So theoretically, in one table are the wrong Urls saved, and in other tables only the IDs saved, that are connected to this wrong Urls.

Test all before with SELECT.
Make a database backup before.

Do it on your own risk.

Afterwork
Invalidate all (arrchived) reports.
core:invalidate-report-data

Run all scheduled tasks manually.
core:run-scheduled-tasks --force

Purge old archived report data.
core:purge-old-archive-data all

Run the archive process (maybe server and time expansive).
core:archive

Make a database backup.
mysqldump

Yes, it’s a little bit complicated.
Good luck!

1 Like