diff --git a/02-filter-a-log-file/step1.js b/02-filter-a-log-file/step1.js index 9f1c1bf..e3994bb 100644 --- a/02-filter-a-log-file/step1.js +++ b/02-filter-a-log-file/step1.js @@ -4,4 +4,7 @@ const raw_log = fs.readFileSync(process.argv[2]); const lines = raw_log.toString().split("\n"); -console.log(lines); +const search = new RegExp(process.argv[3]); + +// continue here, how do you find all the lines matching the regex? +// how complex can you make this? Is it necessary? diff --git a/02-filter-a-log-file/step2.js b/02-filter-a-log-file/step2.js new file mode 100644 index 0000000..3cdc1e0 --- /dev/null +++ b/02-filter-a-log-file/step2.js @@ -0,0 +1,8 @@ +import fs from "fs"; + +const raw_log = fs.readFileSync(process.argv[2]); + +const lines = raw_log.toString().split("\n"); + +// now you have to figure out how to split each line of the +// web log into something meaningful