from aliyun.log import LogClient, GetHistogramsRequest, GetLogsRequest
Endpoint = "https://cn-beijing.log.aliyuncs.com" # 连接阿里云日志接口
client = LogClient(Endpoint, accessKeyId, accessKey)
request = GetLogsRequest(project, logstore, fromTime='',toTime='', query='',line=50)
# 阿里云默认是取100条 line设置拉取条数,line=-1 拉取全部
res = client.get_logs(request)
for i in res.body:
pprint(i)
python 获取阿里云日志
最新推荐文章于 2024-05-09 15:08:42 发布