Notifications
Clear all
Questions and Discussions
2
Posts
1
Users
0
Likes
822
Views
Topic starter
03/08/2020 5:46 pm
Command to extract logs from last one hour .
Topic starter
03/08/2020 5:47 pm
Use following command.
i=`date -d "1 hour ago"| awk '{print $2}'`; j=`date -d "1 hour ago"| awk '{print $3}'`;k=`date -d "1 hour ago"| awk '{print $4}'`; awk -v i="$i" -v j="$j" -v k="$k" '$1 == i && $2 == j && $3 > k {print $0}' maillog