Skip to content

Instantly share code, notes, and snippets.

@mitkot
Last active February 10, 2016 07:41
Show Gist options
  • Save mitkot/1fe18f7a06e363b670d7 to your computer and use it in GitHub Desktop.
Save mitkot/1fe18f7a06e363b670d7 to your computer and use it in GitHub Desktop.
How to get an event of ModifyInstanceAttribute and output as csv
aws s3 cp s3://(CloudTrail Bucket)/AWSLogs/(Account ID)/CloudTrail/(region)/yyyy/mm/dd/(cloud trail log file name).json.gz - |zcat |jq -r '.Records[]|select (.eventName=="ModifyInstanceAttribute")|[.eventTime, .requestParameters.instanceId,.requestParameters.instanceType.value]|@csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment