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

+ 3 - 1
hhh/aws-monitor/cl-test.py

@@ -1,9 +1,11 @@
 import subprocess
+import json
 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)
 
 #clstr=str(cl)
 #lines=clstr.split('\n')
-print(cl)
+js=json.loads(cl)
+print(js)