Such as: Filter out the secure log from August 30 22 o'clock to August 31 8 o'clock
Log format:
03:00:01 localhost crond[21772]: pam_limits (crond:session): Unknown limit type ' proc ' to 03:01:01 localhost cron D[21775]: Pam_limits (crond:session): Unknown limit type ' proc ' to 03:01:01 localhost crond[21775]: pam_limits (crond: session): Unknown limit type ' proc ' 03:30:01 localhost crond[21828]: pam_limits (crond:session): Unknown limit type ' Proc
Using grep filtering
# Cat/var/log/secure | Grep-e "(30 22| 31 08) "This section only filters out the 30 22| 31 82 Days of
2. Using SED filtering
# sed-n '/aug 22:00:01/,/aug 08:30:01/p '/var/log/secure
This article is from the "willing to share with you" blog, please be sure to keep this source http://pengjc.blog.51cto.com/9255463/1844601
Linux filters out logs between time periods