Parse log to sort entries by number of occurrences
€8-30 EUR
Завершено
Опублікований over 4 years ago
€8-30 EUR
Оплачується при отриманні
The purpose for this is to use as a very simple near-real-time analytics system by generating a list of 20 most accessed urls from different users within the last hour.
I have a live log file, generated by the webserver, containing multiple rows of three key-value pairs: {"date":"[x]", "user":"[y]","slug":"[z]"} - currently ndjson (example attached) but I can output it in any convenient format, for parsing as easily as possible. The log is expected to have around 10.000 entries per hour and the machine is 2CPU 2GB, so kindly advise on estimated CPU load for the job.
I want a php script (can use wordpress hooks) that will:
1. Run in the background as a cron job every 15 minutes;
2. Start by deleting all log entries older than one hour;
3. Find the 20 slugs with the most entries from non-repeating users;
4. Write the 20 slugs to a database field as a string (such as "slug-1,slug-2,slug-3,slug-4").
Greetings,
My name is Page and I have been working from last 8 years in IT field. I am very much interested in your project and would like to invite you for further discussion over chat board.
Waiting for your positive response!
Regards,
Page O.