[comment]: # ({1849a860-66bd8c75})
# 5 审计日志

[comment]: # ({/1849a860-66bd8c75})

[comment]: # ({ae8ba5df-b503e694})
#### 概述

在 *Reports* → *Audit log* 部分，可以查看用户和系统活动记录。

::: noteclassic
要收集并显示审计记录，必须在 *Administration* → [*Audit log*](/manual/web_interface/frontend_sections/administration/audit_log) 部分勾选 *Enable audit logging* 复选框。
如果未启用此设置，活动历史将不会记录到数据库中，也不会显示在审计日志中。
:::

![](../../../../../assets/en/manual/web_interface/audit_log.png){width="600"}

审计日志显示以下数据：

|Column|Description|
|--|--------|
|*Time*|审计记录的时间戳。|
|*User*|执行该活动的用户。|
|*IP*|发起该活动的 IP。<br>点击超链接后，将按此 IP 过滤审计日志记录。|
|*Resource*|受影响资源的类型（*API token*、*Action*、*Authentication*、*Autoregistration* 等）。|
|*ID*|受影响资源的 ID。<br>点击超链接后，将按此资源 ID 过滤审计日志记录。|
|*Action*|活动类型（*Add*、[*Configuration refresh*](/manual/web_interface/frontend_sections/administration/proxies#mass-editing-options)、*Delete*、*Execute*、*Failed login*、*History clear*、*Login*、*Logout*、[*Push*](/manual/api/reference/history/push)、*Update*）。|
|*Recordset ID*|由同一操作生成的所有审计日志记录共享的 ID。<br>例如，当将模板链接到主机时，每个继承的模板实体（监控项、触发器等）都会创建一条单独的审计日志记录 - 这些记录都具有相同的 *Recordset ID*。<br>点击超链接后，将按此 *Recordset ID* 过滤审计日志记录。|
|*Details*|资源的描述以及所执行活动的详细信息。<br>如果某条记录包含两行以上内容，将显示额外的 *Details* 链接。点击此链接可查看完整的更改列表。|

::: noteclassic
当 [trapper item](/manual/config/items/itemtypes/trapper) 或 [HTTP agent item](/manual/config/items/itemtypes/http)（已启用 trapping）接收到数据时，
只有在数据是通过 [`history.push`](/manual/api/reference/history/push) API 方法发送，而不是通过 [Zabbix sender](/manual/concepts/sender) 工具发送的情况下，才会在审计日志中添加一条记录。
:::

[comment]: # ({/ae8ba5df-b503e694})

[comment]: # ({c3b79ea3-84ad1722})
#### 按钮

页面右上角的按钮提供以下选项：

|   |   |
|--|--------|
|![](../../../../../assets/en/manual/web_interface/button_csv.png)|将所有页面中的审计日志记录导出为 CSV 文件。如果应用了过滤器，则只会导出筛选后的记录。|

[comment]: # ({/c3b79ea3-84ad1722})

[comment]: # ({3d62a059-d73129d8})
#### 使用筛选器

筛选器位于 *审计日志* 栏下方。
单击右上角的 *筛选器* 选项卡即可将其展开或折叠。

![](../../../../../assets/en/manual/web_interface/audit_log_filter.png){width="600"}

您可以使用筛选器按用户、受影响的资源、资源 ID、执行的操作（*Recordset ID*）和 IP 缩小记录范围。
根据资源的不同，还可以在筛选器中选择一个或多个特定操作。

为了获得更好的搜索性能，所有数据在搜索时都不会解析宏。

[comment]: # ({/3d62a059-d73129d8})

[comment]: # ({b82cc780-23b43559})
#### 时间段选择器

过滤器旁边的时间段选择器允许通过一次鼠标点击选择常用的时间段。  
更多信息，请参见[时间段和主机选择器](/manual/web_interface/time_period_selector)。

[comment]: # ({/b82cc780-23b43559})
