Last active
April 10, 2019 19:16
-
-
Save gdm/f829b5bb3d50f9f04ee8567607f0eb96 to your computer and use it in GitHub Desktop.
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
| # usefull when parse output frow aws cli | |
| # from https://github.com/stedolan/jq/issues/370 | |
| jq '.Attributes[] | select (.Name == "public_ip") | .Value' | |
| # json to bash-style env | |
| jq -r 'to_entries | .[] | .key + "=\"" + .value + "\""' | grep -P '^AWS_(REGION|ACCESS_KEY|SECRET|SESSION)' | |
| # parse CloudTail logs (from http://flaws2.cloud/defender3.htm ) | |
| jq -cr '.Records[]|[.eventTime, .sourceIPAddress, .userIdentity.arn, .userIdentity.accountId, .userIdentity.type, .eventName]|@tsv' | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment