代码之家  ›  专栏  ›  技术社区  ›  Arafat Nalkhande

如何在查询cloudtrail事件时提供多个查找属性

  •  2
  • Arafat Nalkhande  · 技术社区  · 6 年前

    当我执行以下命令时

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

    它给出了“CreateTopic”类型的事件列表

    当我执行以下命令时

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

    它给出了与用户“MyUserName”相关的事件列表

    不过,我想查询所有类型为“CreateTopic”且与用户“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 AttributeKey=Username,AttributeValue=MyUserName 
    aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=CreateTopic --lookup-attributes AttributeKey=Username,AttributeValue=MyUserName 
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   kenlukas Uday Allu    6 年前

    从文件上看, --lookup-attributes 只支持一个项目列表。

    --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

    推荐文章