Closed s22-tech closed 3 months ago
You can either filter that beforehand with any text-parsing tool like grep
, although it depends on how you obtain your logs, or you can do it in PHP by using the stamp
field. Something like:
$from = strtotime('2024-07-21 00:00:00');
$to = strtotime('2024-07-28 23:59:59');
$entry = $parser->parse($logline);
if ($entry->stamp >= $from && $entry->stamp <= $to) {
// do something
}
Is there a built-in way to print log entries between 2 dates, e.g. to show data for the week of July 28th, from Sunday to Saturday only? Thanks!