6

Is it possible to query cloudtrail with multiple lookup attributes

When I execute following

aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTopic 

It gives me list of events of type 'CreateTopic'

When I execute following

aws cloudtrail lookup-events --lookup-attributes AttributeKey=AttributeKey=Username,AttributeValue=MyUserName 

It gives me list of events related to user 'MyUserName'

However what I want is to query for all events of type 'CreateTopic' and related to user 'MyUserName'

I tried following but none of them works

aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTopic,AttributeKey=Username,AttributeValue=MyUserName 
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTopic AttributeKey=Username,AttributeValue=MyUserName 
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTopic --lookup-attributes AttributeKey=Username,AttributeValue=MyUserName 
Arafat Nalkhande
  • 11,078
  • 9
  • 39
  • 63

1 Answers1

7

From the documentation, --lookup-attributes only supports a one item list.

--lookup-attributes (list)

    Contains a list of lookup attributes. Currently the list can contain only one item.

https://docs.aws.amazon.com/cli/latest/reference/cloudtrail/lookup-events.html

kenlukas
  • 3,616
  • 9
  • 25
  • 36