download_db_log_file_portion
¶
download_db_log_file_portion(
*,
config_overrides: Optional[RDSClientConfig] = None,
db_instance_identifier: Optional[String] = None,
log_file_name: Optional[String] = None,
marker: Optional[String] = None,
number_of_lines: Optional[Integer] = None,
) -> DownloadDBLogFilePortionDetails
Downloads all or a portion of the specified log file, up to 1 MB in size.
This command doesn't apply to RDS Custom.
This operation uses resources on database instances. Because of this, we recommend publishing database logs to CloudWatch and then using the GetLogEvents operation. For more information, see GetLogEvents in the Amazon CloudWatch Logs API Reference.
Parameters:
-
db_instance_identifier(Optional[String], default:None) –The customer-assigned name of the DB instance that contains the log files you want to list.
Constraints:
-
Must match the identifier of an existing DBInstance.
-
-
log_file_name(Optional[String], default:None) –The name of the log file to be downloaded.
-
marker(Optional[String], default:None) –The pagination token provided in the previous request or "0". If the Marker parameter is specified the response includes only records beyond the marker until the end of the file or up to NumberOfLines.
-
number_of_lines(Optional[Integer], default:None) –The number of lines to download. If the number of lines specified results in a file over 1 MB in size, the file is truncated at 1 MB in size.
If the NumberOfLines parameter is specified, then the block of lines returned can be from the beginning or the end of the log file, depending on the value of the Marker parameter.
-
If neither Marker or NumberOfLines are specified, the entire log file is returned up to a maximum of 10000 lines, starting with the most recent log entries first.
-
If NumberOfLines is specified and Marker isn't specified, then the most recent lines from the end of the log file are returned.
-
If Marker is specified as "0", then the specified number of lines from the beginning of the log file are returned.
-
You can download the log file in blocks of lines by specifying the size of the block using the NumberOfLines parameter, and by specifying a value of "0" for the Marker parameter in your first request. Include the Marker value returned in the response as the Marker value for the next request, continuing until the AdditionalDataPending response element returns false.
-
Raises:
-
DBInstanceNotFoundFault–DBInstanceIdentifierdoesn't refer to an existing DB instance. -
DBInstanceNotReadyFault–An attempt to download or examine log files didn't succeed because an Aurora Serverless v2 instance was paused.
-
DBLogFileNotFoundFault–LogFileNamedoesn't refer to an existing DB log file. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To download a DB log file The following example downloads only the latest part of your log file.
>>> client.download_db_log_file_portion(db_instance_identifier='test-instance', log_file_name='log.txt')
Source code in docs_src/capo_rds/_services/rds.py
9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 | |