Skip to content

Instantly share code, notes, and snippets.

View davispeixoto's full-sized avatar

Davis Peixoto davispeixoto

View GitHub Profile
@davispeixoto
davispeixoto / get_last_10_minutes_from_log.sh
Last active March 29, 2020 20:03
Shell script - BASH - for filtering entries on log from the last 10 minutes only
#!/bin/bash
## Usage
# save the contents of this file to a executable file,
# call it, passing the target log file as first argument
# apapt the lines below for match your log file format
dates=("`date --date="-10 min" "+%_d %H:%M"`" \
"`date --date="-9 min" "+%_d %H:%M"`" \
"`date --date="-8 min" "+%_d %H:%M"`" \