4

I have a log file abc.log in which content is like this when I do a vi on it.

2015-05-28 18:12:00,815 INFO 0x7f6ed23e3700 send_to - recent: 1432861920 from dc:2 client_id: 102
2015-05-28 18:13:01,024 INFO 0x7f6ed23e3700 send_to - recent: 1432861980 from dc:2 client_id: 101
2015-05-28 18:13:42,244 WARN 0x7f6ed26e6700 mgr - Failed to upsert data for userid 3589109212161 with value cat and status -2
2015-05-28 18:14:00,135 INFO 0x7f6ed23e3700 send_to - recent: 1432862040 from dc:2 client_id: 103

I want to see the all the logs between this time frame:

2015-05-28 00:30:00 - 2015-05-28 02:30:00

So basically whatever logs I have between these time frame I want to see it in the same order in which it is there already. Is this possible to do using grep?

john
  • 11,311
  • 40
  • 131
  • 251

1 Answers1

3

From what I understand AWK can be used for this. As well, there's an answer on Stack Overflow already that looks like exactly what you want?

https://unix.stackexchange.com/questions/123979/how-to-extract-logs-between-two-time-stamps

Community
  • 1
  • 1
0X29A
  • 71
  • 6