Brief-Wishbone9091
Member
Code:
LC_ALL=C awk -v beg=10:00:00 -v end=13:00:00 '
match($0, /[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/) {
t = substr($0, RSTART, 8)
if (t >= end) selected = 0
else if (t >= beg) selected = 1
}
selected'
I didn't write this script but I vaguely understand it in gist and what it does..
The date format in our logs is like this (first and second column then rest are stuffs like INFO/DEBUG name of class bla bla...
Code:
2023-09-13 20:21:28
What I want
I want to be able to input the beginning day as well i.e I want logs of 2023-09-12 from 05:30:00 to 13:30:00.
How'd I do it?
I vaguely know it requires some regex and regex I bad at it.