Browse Source

Fixes from today server hacking.

master
Zed A. Shaw 3 weeks ago
parent
commit
120235b670
  1. 10
      02-filter-a-log-file/chains_parser/parser.js
  2. 2
      02-filter-a-log-file/chains_parser/reporter.js

10
02-filter-a-log-file/chains_parser/parser.js

@ -174,13 +174,15 @@ const parse_log_file = async (results, stats, file_name, errors) => {
parser.start(line);
const data = parser.parse();
// skip lines that have content we don't care about
if(data.url.match(skip)) continue;
// convert the date to a only day length
const date_key = format(data.time, "yyyy-MM-dd");
// skip lines that have content we don't care about
if(data.url.match(skip)) {
stats.excluded += 1;
continue;
}
// get the date entry or a new one
const date_entry = results[date_key] || {};

2
02-filter-a-log-file/chains_parser/reporter.js

@ -58,6 +58,8 @@ for(let key of keys) {
}
}
console.log("FROM", keys[0], "TO", keys[keys.length - 1]);
for(let [chain, counts] of Object.entries(by_chain)) {
if(counts.length > OPTS.maxDays) {
console.log(chain);

Loading…
Cancel
Save