I have some Perl scripts modified myself already a little bit,
which are used to analyze the log file of a proxy, and to limit the traffic based on userid or IP.
However, I need some help to streamline and to modify this code even more.
Necessary simplification of existing code:
The actual code allows limits both on traffic and on (approximated) time spent online. All code regarding time spent should be removed.
Additionally, the actual code stores a lot of historical traffic data. This can also be drastically reduced.
Only historical data, relevant for the traffic limits and the period of time, the limits are applied to, needs to be kept.
Additions to actual code:
When the time period of the traffic limit expires, relevant historical data should be purged.
The PERL code to analyze the log runs periodically, and "remembers" the last log line processed. The actual strategy, to read and skip these lines for processing
during next run, is not efficient for long log files. This should be modified to store a pointer within the file instead.
However, there might be a new, but empty log file.
Attached you find the actual code.
I will provide old log files for basic testing and can participate in final test, to keep the budget low for this project.