Docs 菜单
Docs 主页
/ /
Atlas CLI
/ /

atlas accessLogs list

在此页面上

  • 语法
  • 选项
  • 继承选项
  • 举例

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

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

命令语法
atlas accessLogs list [options]
名称
类型
必需
说明
--authResult
字符串
false
Atlas 应返回的身份验证尝试。 设置为成功时,Atlas 会筛选日志以仅返回成功的身份验证尝试。 当设置为失败时,Atlas 会过滤日志以仅返回失败的身份验证尝试。
--clusterName
字符串
false

集群名称。 要了解详情,请参阅 https://dochub.mongodb.org/core/create-cluster-api。

与 --hostname 互斥。

--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

后退

accessLogs