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
10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 | |