|
|
|
|
|
by deathanatos
4054 days ago
|
|
> If you’re grepping logs, you don’t need a regular expression that matches only valid dates because you can assume that the timestamps on the log records are valid dates. Even _if_ I agreed with your assumption[1], are you actually suggesting that 2013-12-(2[4-9]|3.)|2014-..-..|2015-0([123]-..|4-(0.|1[01]))
is a serious solution? I admit that it is shorter than the author's solution, _but it still proves his point_.And then what about multi-line log lines? `grep` can't tell where the next line is; sure, I can -A, but there's no number I can plug in that's going to just work: I need to guess, and if I get a truncated result or too much output, adjust. Worse, I get too much output _and_ a truncated record where I need it… log-cat --from 2013-12-24 --to 2015-04-11 | grep <further processing>
[1] most log file formats I've run across do not guarantee the date to appear in a given location. |
|