Created
February 4, 2016 09:37
-
-
Save mitsuru793/d793fd48af8126321f3a to your computer and use it in GitHub Desktop.
railsのログファイルからアクセスのあった日付を列挙
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
cat log/production.log \ | |
| cut -d ' ' -f2 | awk '{print substr($0, 2, 10)}' \ | |
| grep -v '^\s*$' \ | |
| grep -E '[0-9]{4}-[0-9]{2}-[0-9]{2}' \ | |
| uniq | |
# => | |
# 2016-01-09 | |
# 2016-01-08 | |
# 2016-01-09 | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment