DescribeSubscriptionFiltersCommand

Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CloudWatchLogsClient, DescribeSubscriptionFiltersCommand } from "@aws-sdk/client-cloudwatch-logs"; // ES Modules import
// const { CloudWatchLogsClient, DescribeSubscriptionFiltersCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
const client = new CloudWatchLogsClient(config);
const input = { // DescribeSubscriptionFiltersRequest
  logGroupName: "STRING_VALUE", // required
  filterNamePrefix: "STRING_VALUE",
  nextToken: "STRING_VALUE",
  limit: Number("int"),
};
const command = new DescribeSubscriptionFiltersCommand(input);
const response = await client.send(command);
// { // DescribeSubscriptionFiltersResponse
//   subscriptionFilters: [ // SubscriptionFilters
//     { // SubscriptionFilter
//       filterName: "STRING_VALUE",
//       logGroupName: "STRING_VALUE",
//       filterPattern: "STRING_VALUE",
//       destinationArn: "STRING_VALUE",
//       roleArn: "STRING_VALUE",
//       distribution: "Random" || "ByLogStream",
//       applyOnTransformedLogs: true || false,
//       creationTime: Number("long"),
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

DescribeSubscriptionFiltersCommand Input

Parameter
Type
Description
logGroupName
Required
string | undefined

The name of the log group.

filterNamePrefix
string | undefined

The prefix to match. If you don't specify a value, no prefix filter is applied.

limit
number | undefined

The maximum number of items returned. If you don't specify a value, the default is up to 50 items.

nextToken
string | undefined

The token for the next set of items to return. (You received this token from a previous call.)

DescribeSubscriptionFiltersCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
nextToken
string | undefined

The token for the next set of items to return. The token expires after 24 hours.

subscriptionFilters
SubscriptionFilter[] | undefined

The subscription filters.

Throws

Name
Fault
Details
InvalidParameterException
client

A parameter is specified incorrectly.

ResourceNotFoundException
client

The specified resource does not exist.

ServiceUnavailableException
server

The service cannot complete the request.

CloudWatchLogsServiceException
Base exception class for all service exceptions from CloudWatchLogs service.