DescribeLogStreams
Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.
This operation has a limit of five transactions per second, after which transactions are throttled.
Request Syntax
{
"descending": boolean,
"limit": number,
"logGroupName": "string",
"logStreamNamePrefix": "string",
"nextToken": "string",
"orderBy": "string"
}Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- descending
If the value is true, results are returned in descending order. If the value is to false, results are returned in ascending order. The default value is false.
Type: Boolean
Required: No
- limit
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 50.
Required: No
- logGroupName
The name of the log group.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
[\.\-_/#A-Za-z0-9]+Required: Yes
- logStreamNamePrefix
The prefix to match.
You cannot specify this parameter if
orderByisLastEventTime.Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
[^:*]*Required: No
- nextToken
The token for the next set of items to return. (You received this token from a previous call.)
Type: String
Length Constraints: Minimum length of 1.
Required: No
- orderBy
If the value is
LogStreamName, the results are ordered by log stream name. If the value isLastEventTime, the results are ordered by the event time. The default value isLogStreamName.If you order the results by event time, you cannot specify the
logStreamNamePrefixparameter.lastEventTimestamp represents the time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the number of milliseconds since Jan 1, 1970 00:00:00 UTC. lastEventTimeStamp updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, but may take longer in some rare situations.
Type: String
Valid Values:
LogStreamName | LastEventTimeRequired: No
Response Syntax
{
"logStreams": [
{
"arn": "string",
"creationTime": number,
"firstEventTimestamp": number,
"lastEventTimestamp": number,
"lastIngestionTime": number,
"logStreamName": "string",
"storedBytes": number,
"uploadSequenceToken": "string"
}
],
"nextToken": "string"
}Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- logStreams
The log streams.
Type: array of LogStream objects
- nextToken
The token for the next set of items to return. The token expires after 24 hours.
Type: String
Length Constraints: Minimum length of 1.
Errors
For information about the errors that are common to all actions, see Common Errors.
Example
To list the log streams for a log group
The following example lists the log streams associated with the specified log group.
Sample Request
POST / HTTP/1.1
Host: logs.<region>.<domain>
X-Amz-Date: <DATE>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeLogStreams
{
"logGroupName": "my-log-group"
}Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
"logStreams": [
{
"storageBytes": 1048576,
"arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-1:log-stream:my-log-stream-1",
"creationTime": 1393545600000,
"firstEventTimestamp": 1393545600000,
"lastEventTimestamp": 1393567800000,
"lastIngestionTime": 1393589200000,
"logStreamName": "my-log-stream-1",
"uploadSequenceToken": "88602967394531410094953670125156212707622379445839968487"
},
{
"storageBytes": 5242880,
"arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-2:log-stream:my-log-stream-2",
"creationTime": 1396224000000,
"firstEventTimestamp": 1396224000000,
"lastEventTimestamp": 1396235500000,
"lastIngestionTime": 1396225560000,
"logStreamName": "my-log-stream-2",
"uploadSequenceToken": "07622379445839968487886029673945314100949536701251562127"
}
]
}See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following:

