Created
October 27, 2017 11:10
-
-
Save artygus/c8d39f3bab621bee7de8ed0cb5865ed1 to your computer and use it in GitHub Desktop.
Extract date from gzipped access log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gzip -dc access.log.1.gz | head -c 200 | head -n 1 | awk '{print $4}' | xargs -I {} date -jf "[%d/%b/%Y" \{} +%Y-%m-%d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
on linux it's gonna be