tencent cloud

TencentDB for MongoDB

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Strengths
Use Cases
Cluster Architecture
Product Specifications
Features
Regions and AZs
Terms
Service Regions and Service Providers
Purchase Guide
Billing Overview
MongoDB Pricing
Billing Formula
Payment Overdue
Backup Space Billing
Configuration Adjustment Billing
Getting Started
Quickly Creating an Instance
Connecting to a TencentDB for MongoDB Instance
Reading/Writing Database
Operation Guide
Access Management
Instance Management
Node Management
Version Upgrade
Network Configuration
Monitoring
Backup and Rollback
Database Audit
Data Security
SSL Authentication
Log Management
Database Management
Multi-AZ Deployment
Disaster Recovery/Read-Only Instances
Parameter Configuration
Recycle Bin
Task Management
Performance Optimization
Data Migration Guide
Practical Tutorial
Optimizing Indexes to Break Through Read/Write Performance Bottlenecks
Troubleshooting Mongos Load Imbalance in Sharded Cluster
Considerations for Using Shard Clusters
Sample of Reading and Writing Data in MongoDB Instance
Methods for Importing and Exporting Data Based on CVM Connected with MongoDB
What to Do for Errors of Repeated Instance Creation and Deletion of Databases with the Same Names?
Troubleshooting MongoDB Connection Failures
Shard Removal Task: Guide for Confirming the Progress and Troubleshooting Issues
Performance Fine-Tuning
Ops and Development Guide
Development Specifications
Command Support in Sharded Cluster v3.2
Command Support in v3.6
Development Ops
Troubleshooting
Increased Slow Queries
Number of Connections Exceeding Limit
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Backup APIs
Account APIs
Other APIs
Task APIs
Introduction
Data Types
Error Codes
Instance Connection
Shell Connection Sample
PHP Connection Sample
Node.js Connection Sample
Java Connection Sample
Python Connection Sample
Python Read/Write Sample
Go Connection Sample
PHP Reconnection Sample
Product Performance
Test Environment
Test Method
Test Result
FAQs
Cost
Features
Sharded Cluster
Instance
Rollback and Backup
Connection
Data Migration
Others
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

Managing Audit Log

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-07-15 16:46:00

Scenarios

After enabling the Database Audit service, the system starts recording related operations of TencentDB for MongoDB. You can view the database audit log information at any time, including database request access time, client IP address, account name, execution statement, and time consumed by the execution statement.

Usage Instructions

Currently, only Tencent Cloud private network addresses are provided for downloading log files. You can download files via a Tencent Cloud CVM instance in the same region. (For example, to download the audit logs of a database instance in the Beijing region, use a CVM instance in the Beijing region.)
Log files are valid for 24 hours. You should download them promptly.
The number of log files for each database instance should not exceed 30. You need to delete the log files after download.
If the displayed status is Failed, there may be too many logs. You can narrow the time range to download log files in batches.

Prerequisites

The Creating a TencentDB for MongoDB instance operation has been completed, and the instance has performed the Enabling Database Audit process.
The status of the replica set instance or sharded instance of TencentDB for MongoDB is Running.

Viewing Audit Logs

2. In the left sidebar, select MongoDB > Database Audit.
3. At the top of the right Database Audit page, select Region.
4. In the upper right corner of the audit instance list, select an instance with Audit Status being Enabled.
5. Click the instance ID with auditing enabled to redirect to the Audit Log page to view the corresponding log.
6. Select the time period for the audit log in the time box.
7. In the search box, you can search audit logs based on key information such as Client IP Address, Account Name, Operation Type, Execution Time, Number of Affected Rows, and Execution Status Code.
Note
Client IP addresses can be filtered using * as the condition. For example, if you search for Client IP address: 10.22.23.2*, IP addresses starting with 10.22.23.2 will be matched.
Operation type: You can perform a combined search by selecting the key tag Operation Type. Check multiple operation types for simultaneous search and use "|" to split conditions. If any one of the conditions is matched, the search results will be returned.
When you input multiple filter tags for searching, use the Enter key to split the filter tags. The search result will return audit logs that match all filter tags simultaneously.
8. View audit logs. The audit log fields are shown in the table below.

Number
Interface Parameter
Parameter Description
1
Time
Operation time for database access.
2
Client IP
Client IP address for database access.
3
Database Account
Account name for database access.
4
Operation Type
Type of the operation statement executed for database access. Click

to select the type to view in the drop-down list.
4
Command
Request statement executed for database access.
5
Affected Rows
Number of changed database rows after the operation statement is executed.
6
Execution Status Code
Status code returned after the operation statement is executed.
0: indicates successful execution.
-1: indicates execution failure.
18: identity authentication failure.
334: MongoDB authentication protocol unavailable.
7
Execution Time
Time consumed by the operation statement.

Generating and Downloading Audit Log Files

1. In the upper right corner of the audit log list, click

.

2. In the Create Log File dialog box, click Generate File to initiate the log file creation task.
3. On the audit log file list page, view the audit log file.
Note
Currently, only Tencent Cloud private network addresses are provided for downloading log files. You can download files via a Tencent Cloud CVM instance in the same region. (For example, to download the audit logs of an instance in the Beijing region, use a CVM instance in the Beijing region.)
Log files are valid for 24 hours. You should download them promptly.
The number of log files for each database instance should not exceed 30. You need to delete the log files after download.
If the displayed status is Failed, there may be too many logs. You can narrow the time range to download log files in batches.

Parameter
Parameter Description
File Name
Name of the audit log file, automatically generated by the system.
Creation Time
Generation time of the audit log file.
Status
Status of the audit log file generation task, including generating and generated.
Size
Size of the audit log file.
Private Network Download Address
The private network address can be copied to download log files.
Operation
Click Delete to clean up audit log files.

More Operations

You can manage the audit log list through the following operations.

Click

to customize audit log list fields.
Click

to refresh the audit log list.
Click

to directly go to the audit log file list page.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백