Your Name %!s(int64=3) %!d(string=hai) anos
pai
achega
71cb40bc3b
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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)