Your Name 3 年之前
父節點
當前提交
71cb40bc3b
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      hhh/aws-monitor/cl-test.py

+ 4 - 0
hhh/aws-monitor/cl-test.py

@@ -1,5 +1,6 @@
 import subprocess
 import json
+import sys
 cmd='aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=RunInstances --max-results 20 --region us-east-1'
 cmds=cmd.split(' ')
 cl=subprocess.run(cmds,text=True)
@@ -8,6 +9,9 @@ clstr=str(cl)
 lines=clstr.split('\n')
 for l in lines:
     print(l)
+    if "EventName" in l:
+        print(l)
+        sys.exit()
 #js=json.loads(str(cl))
 #print(js)