download_db_log_file_portion
async
¶
download_db_log_file_portion(
*,
config_overrides: Optional[AsyncRDSClientConfig] = 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.
>>> await client.download_db_log_file_portion(db_instance_identifier='test-instance', log_file_name='log.txt')
Source code in docs_src/capo_rds/_services/async_rds.py
10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 | |