Skip to main content
Became Hot Network Question
added 14 characters in body
Source Link

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded 

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

date -d "@$(( $(date +%s) - 60 ))" +"%c" Tue Jun 3 11:05:00 2025 

But now I'm stuck on how to catch the rows that are after this date. Can

Can anyone help me on this?

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

But now I'm stuck on how to catch the rows that are after this date. Can anyone help me on this?

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded 

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c" Tue Jun 3 11:05:00 2025 

But now I'm stuck on how to catch the rows that are after this date.

Can anyone help me on this?

deleted 1 character in body
Source Link
Paulo
  • 63
  • 6

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

But now I'm stuck on how to catch the rows that are after this date. Can anyone helophelp me on this?

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

But now I'm stuck on how to catch the rows that are after this date. Can anyone helop me on this?

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

But now I'm stuck on how to catch the rows that are after this date. Can anyone help me on this?

Source Link
Paulo
  • 63
  • 6

Get all log lines from last minute with busybox

I have an openwrt router (so no journalctl and only busybox commands), and would like to extract the logs from the last minute.

The logs are like this:

Tue Jun 3 11:06:43 2025 authpriv.info dropbear[7018]: Child connection from

Tue Jun 3 11:06:44 2025 authpriv.notice dropbear[7018]: Pubkey auth succeeded

And my problem is that it's not numeric... I can generate the date from which I want to extract:

date -d "@$(( $(date +%s) - 60 ))" +"%c"

Tue Jun 3 11:05:00 2025

But now I'm stuck on how to catch the rows that are after this date. Can anyone helop me on this?