Last active
January 9, 2019 18:23
-
-
Save jayers99/a196201ba2b38efded07ca464417c058 to your computer and use it in GitHub Desktop.
AWS Flow Log Sample
This file contains hidden or 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
# column names | |
# https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html | |
logGroupName= | |
logStreamName= | |
aws logs filter-log-events --start-time `date -d 2018-9-28T18:00:00Z +%s`000 --log-group-name $logGroupName --log-stream-names $logStreamName --filter-pattern REJECT | |
aws logs filter-log-events --start-time `date -d 2018-9-28T18:00:00Z +%s`000 --log-group-name $logGroupName --log-stream-names $logStreamName --filter-pattern REJECT | jq -r '.events[] | "\(.timestamp) \(.message)"' | cut -d ' ' -f1,5,6,7,8,14 | awk '{print system("date -d @" substr($0,1,10)) substr($0,14)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment