Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs 菜单
Docs 主页
/ /
Atlas CLI
/ /

atlas accessLogs list

检索由集群名称或主机名标识的集群的访问日志。

公共预览版:从MongoDB Atlas Admin API自动生成的 atlas api 子命令提供了对 Admin API的全面覆盖,目前处于公共预览阶段(请通过以下网址提供反馈: https:// 反馈.mongodb.com/ forum/930808 -atlas-cli )。 Admin API功能有自己的发布生命周期,您可以通过提供的API端点文档链接进行检查。

要使用此命令,您必须使用具有项目监控管理员角色的用户帐户或 API 密钥进行身份验证。

命令语法
atlas accessLogs list [options]
名称
类型
必需
说明

--authResult

字符串

false

Atlas 应返回的身份验证尝试。 设置为成功时,Atlas 会筛选日志以仅返回成功的身份验证尝试。 当设置为失败时,Atlas 会过滤日志以仅返回失败的身份验证尝试。

--clusterName

字符串

false

--end

字符串

false

Atlas 从数据库访问日志返回的最后一个条目的时间戳(自Unix纪元以来已经过去的毫秒数)。

-h,--help

false

列表帮助

--hostname

字符串

false

应接收身份验证尝试的目标节点的完全限定域名 (FQDN)。

与 --clusterName 互斥。

--ip

字符串

false

尝试与数据库进行身份验证的 IP 地址。 Atlas 筛选返回的日志以包含仅具有此 IP 地址的文档。

--nLog

int

false

要返回的最大日志行数。

-o, --output

字符串

false

输出格式。 有效值为 json、json-path、go-template 或 go-template-file。 要查看完整输出,请使用 -o json 选项。

--projectId

字符串

false

标识要使用的项目的十六进制字符串。 此选项会覆盖配置文件或环境变量中的设置。

--start

字符串

false

Atlas 从数据库访问日志返回的第一个条目的时间戳,以毫秒为单位,自Unix纪元以来已经过去的毫秒数。

名称
类型
必需
说明

-P, --profile

字符串

false

要从配置文件中使用的配置文件的名称。 要了解 Atlas CLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-save-connection-settings。

# Return a JSON-formatted list of all authentication requests made against the cluster named Cluster0 for the project with ID 618d48e05277a606ed2496fe:
atlas accesslogs list --output json --projectId 618d48e05277a606ed2496fe --clusterName Cluster0
# Return a JSON-formatted list of all authentication requests made against the hostname named atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net for the project stored in the profile atlas-dev:
atlas accesslogs list --hostname atlas-dqrlj4-shard-00-00.g1nxq.mongodb-dev.net --profile atlas-dev --output json

后退

accessLogs

在此页面上