Created
April 28, 2021 19:24
-
-
Save ChrisSwanson/f7e1eb6bc04e55b137615ed695ecbdc7 to your computer and use it in GitHub Desktop.
Cloudtrail search to JSON
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
#!/usr/bin/bash | |
# this one liner searches for a value recursively in cloudtrail logs, to output | |
# a json structure that can be parsed back through jq later for further slicing | |
# and dicing of the data. | |
zgrep -Rhi "$VALUE" . | jq -c '.[]' | awk '{ print $0, "\n" }' > results.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment