sergio_educacionit

log reader

May 16th, 2026
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. consulta="$@"
  4.  
  5. registro=$(cat custom.log | grep "$consulta" | tail -1)
  6.  
  7.  
  8. echo "Ultimo registro con '$consulta':"
  9. timestamp=$(echo $registro | cut -d " " -f 1)
  10. mensaje=$(echo $registro | cut -d " " -f 2-999)
  11. echo $(date -d @$timestamp) $mensaje
Advertisement
Add Comment
Please, Sign In to add comment