Last active
January 2, 2020 13:27
-
-
Save packetchef/94d14e6f3e62d530aeee7d3051efe8d6 to your computer and use it in GitHub Desktop.
Demo of AWS CLI query capability, searching by a field and renaming fields for a table
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
# Equality match: | |
$ aws securityhub list-members --query "Members[?MemberStatus=='Associated'].{AccountId:AccountId,MasterId:MasterId,MemberStatus:MemberStatus,UpdatedAt:UpdatedAt}" --output table | |
------------------------------------------------------------------------------ | |
| ListMembers | | |
+--------------+---------------+---------------+-----------------------------+ | |
| AccountId | MasterId | MemberStatus | UpdatedAt | | |
+--------------+---------------+---------------+-----------------------------+ | |
| 112233445566| 101010101010 | Associated | 2019-11-11T13:07:04.185Z | | |
| 667788990011| 101010101010 | Associated | 2019-11-22T17:04:41.795Z | | |
+--------------+---------------+---------------+-----------------------------+ | |
# Partial match: | |
$ aws securityhub list-members --query "Members[?contains(MemberStatus,`Associat`)==`true`].{AccountId:AccountId,MasterId:MasterId,MemberStatus:MemberStatus,UpdatedAt:UpdatedAt}" --output table | |
------------------------------------------------------------------------------ | |
| ListMembers | | |
+--------------+---------------+---------------+-----------------------------+ | |
| AccountId | MasterId | MemberStatus | UpdatedAt | | |
+--------------+---------------+---------------+-----------------------------+ | |
| 112233445566| 101010101010 | Associated | 2019-11-11T13:07:04.185Z | | |
| 667788990011| 101010101010 | Associated | 2019-11-22T17:04:41.795Z | | |
+--------------+---------------+---------------+-----------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment