Class: AWS.CloudWatchLogs
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.CloudWatchLogs
- Identifier:
- cloudwatchlogs
- API Version:
- 2014-03-28
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
You can use Amazon CloudWatch Logs to monitor, store, and access your log files from EC2 instances, CloudTrail, and other sources. You can then retrieve the associated log data from CloudWatch Logs using the CloudWatch console. Alternatively, you can use CloudWatch Logs commands in the Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch Logs SDK.
You can use CloudWatch Logs to:
-
Monitor logs from EC2 instances in real time: You can use CloudWatch Logs to monitor applications and systems using log data. For example, CloudWatch Logs can track the number of errors that occur in your application logs. Then, it can send you a notification whenever the rate of errors exceeds a threshold that you specify. CloudWatch Logs uses your log data for monitoring so no code changes are required. For example, you can monitor application logs for specific literal terms (such as "NullReferenceException"). You can also count the number of occurrences of a literal term at a particular position in log data (such as "404" status codes in an Apache access log). When the term you are searching for is found, CloudWatch Logs reports the data to a CloudWatch metric that you specify.
-
Monitor CloudTrail logged events: You can create alarms in CloudWatch and receive notifications of particular API activity as captured by CloudTrail. You can use the notification to perform troubleshooting.
-
Archive log data: You can use CloudWatch Logs to store your log data in highly durable storage. You can change the log retention setting so that any log events earlier than this setting are automatically deleted. The CloudWatch Logs agent helps to quickly send both rotated and non-rotated log data off of a host and into the log service. You can then access the raw log data when you need it.
Sending a Request Using CloudWatchLogs
var cloudwatchlogs = new AWS.CloudWatchLogs();
cloudwatchlogs.associateKmsKey(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the CloudWatchLogs object uses this specific API, you can
construct the object by passing the apiVersion option to the constructor:
var cloudwatchlogs = new AWS.CloudWatchLogs({apiVersion: '2014-03-28'});
You can also set the API version globally in AWS.config.apiVersions using
the cloudwatchlogs service identifier:
AWS.config.apiVersions = {
cloudwatchlogs: '2014-03-28',
// other service API versions
};
var cloudwatchlogs = new AWS.CloudWatchLogs();
Constructor Summary collapse
-
new AWS.CloudWatchLogs(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
associateKmsKey(params = {}, callback) ⇒ AWS.Request
Associates the specified KMS key with either one log group in the account, or with all stored CloudWatch Logs query insights results in the account.
When you use
AssociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. -
cancelExportTask(params = {}, callback) ⇒ AWS.Request
Cancels the specified export task.
The task must be in the
.PENDINGorRUNNINGstate. -
createDelivery(params = {}, callback) ⇒ AWS.Request
Creates a delivery.
-
createExportTask(params = {}, callback) ⇒ AWS.Request
Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket.
-
createLogAnomalyDetector(params = {}, callback) ⇒ AWS.Request
Creates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.
An anomaly detector can help surface issues by automatically discovering anomalies in your log event traffic.
-
createLogGroup(params = {}, callback) ⇒ AWS.Request
Creates a log group with the specified name.
-
createLogStream(params = {}, callback) ⇒ AWS.Request
Creates a log stream for the specified log group.
-
deleteAccountPolicy(params = {}, callback) ⇒ AWS.Request
Deletes a CloudWatch Logs account policy.
-
deleteDataProtectionPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the data protection policy from the specified log group.
-
deleteDelivery(params = {}, callback) ⇒ AWS.Request
Deletes s delivery.
-
deleteDeliveryDestination(params = {}, callback) ⇒ AWS.Request
Deletes a delivery destination.
-
deleteDeliveryDestinationPolicy(params = {}, callback) ⇒ AWS.Request
Deletes a delivery destination policy.
-
deleteDeliverySource(params = {}, callback) ⇒ AWS.Request
Deletes a delivery source.
-
deleteDestination(params = {}, callback) ⇒ AWS.Request
Deletes the specified destination, and eventually disables all the subscription filters that publish to it.
-
deleteLogAnomalyDetector(params = {}, callback) ⇒ AWS.Request
Deletes the specified CloudWatch Logs anomaly detector.
.
-
deleteLogGroup(params = {}, callback) ⇒ AWS.Request
Deletes the specified log group and permanently deletes all the archived log events associated with the log group.
.
-
deleteLogStream(params = {}, callback) ⇒ AWS.Request
Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.
.
-
deleteMetricFilter(params = {}, callback) ⇒ AWS.Request
Deletes the specified metric filter.
.
-
deleteQueryDefinition(params = {}, callback) ⇒ AWS.Request
Deletes a saved CloudWatch Logs Insights query definition.
-
deleteResourcePolicy(params = {}, callback) ⇒ AWS.Request
Deletes a resource policy from this account.
-
deleteRetentionPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the specified retention policy.
Log events do not expire if they belong to log groups without a retention policy.
. -
deleteSubscriptionFilter(params = {}, callback) ⇒ AWS.Request
Deletes the specified subscription filter.
.
-
describeAccountPolicies(params = {}, callback) ⇒ AWS.Request
Returns a list of all CloudWatch Logs account policies in the account.
.
-
describeConfigurationTemplates(params = {}, callback) ⇒ AWS.Request
Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries.
-
describeDeliveries(params = {}, callback) ⇒ AWS.Request
Retrieves a list of the deliveries that have been created in the account.
A delivery is a connection between a delivery source and a delivery destination .
A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination.
-
describeDeliveryDestinations(params = {}, callback) ⇒ AWS.Request
Retrieves a list of the delivery destinations that have been created in the account.
.
-
describeDeliverySources(params = {}, callback) ⇒ AWS.Request
Retrieves a list of the delivery sources that have been created in the account.
.
-
describeDestinations(params = {}, callback) ⇒ AWS.Request
Lists all your destinations.
-
describeExportTasks(params = {}, callback) ⇒ AWS.Request
Lists the specified export tasks.
-
describeLogGroups(params = {}, callback) ⇒ AWS.Request
Lists the specified log groups.
-
describeLogStreams(params = {}, callback) ⇒ AWS.Request
Lists the log streams for the specified log group.
-
describeMetricFilters(params = {}, callback) ⇒ AWS.Request
Lists the specified metric filters.
-
describeQueries(params = {}, callback) ⇒ AWS.Request
Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.
-
describeQueryDefinitions(params = {}, callback) ⇒ AWS.Request
This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions.
-
describeResourcePolicies(params = {}, callback) ⇒ AWS.Request
Lists the resource policies in this account.
.
-
describeSubscriptionFilters(params = {}, callback) ⇒ AWS.Request
Lists the subscription filters for the specified log group.
-
disassociateKmsKey(params = {}, callback) ⇒ AWS.Request
Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.
When you use
DisassociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. -
filterLogEvents(params = {}, callback) ⇒ AWS.Request
Lists log events from the specified log group.
-
getDataProtectionPolicy(params = {}, callback) ⇒ AWS.Request
Returns information about a log group data protection policy.
.
-
getDelivery(params = {}, callback) ⇒ AWS.Request
Returns complete information about one logical delivery.
-
getDeliveryDestination(params = {}, callback) ⇒ AWS.Request
Retrieves complete information about one delivery destination.
.
-
getDeliveryDestinationPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the delivery destination policy assigned to the delivery destination that you specify.
-
getDeliverySource(params = {}, callback) ⇒ AWS.Request
Retrieves complete information about one delivery source.
.
-
getLogAnomalyDetector(params = {}, callback) ⇒ AWS.Request
Retrieves information about the log anomaly detector that you specify.
.
-
getLogEvents(params = {}, callback) ⇒ AWS.Request
Lists log events from the specified log stream.
-
getLogGroupFields(params = {}, callback) ⇒ AWS.Request
Returns a list of the fields that are included in log events in the specified log group.
-
getLogRecord(params = {}, callback) ⇒ AWS.Request
Retrieves all of the fields and values of a single log event.
-
getQueryResults(params = {}, callback) ⇒ AWS.Request
Returns the results from the specified query.
Only the fields requested in the query are returned, along with a
@ptrfield, which is the identifier for the log record. -
listAnomalies(params = {}, callback) ⇒ AWS.Request
Returns a list of anomalies that log anomaly detectors have found.
-
listLogAnomalyDetectors(params = {}, callback) ⇒ AWS.Request
Retrieves a list of the log anomaly detectors in the account.
.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Displays the tags associated with a CloudWatch Logs resource.
-
listTagsLogGroup(params = {}, callback) ⇒ AWS.Request
The ListTagsLogGroup operation is on the path to deprecation.
-
putAccountPolicy(params = {}, callback) ⇒ AWS.Request
Creates an account-level data protection policy or subscription filter policy that applies to all log groups or a subset of log groups in the account.
Data protection policy
A data protection policy can help safeguard sensitive data that's ingested by your log groups by auditing and masking the sensitive log data.
-
putDataProtectionPolicy(params = {}, callback) ⇒ AWS.Request
Creates a data protection policy for the specified log group.
-
putDeliveryDestination(params = {}, callback) ⇒ AWS.Request
Creates or updates a logical delivery destination.
-
putDeliveryDestinationPolicy(params = {}, callback) ⇒ AWS.Request
Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account.
-
putDeliverySource(params = {}, callback) ⇒ AWS.Request
Creates or updates a logical delivery source.
-
putDestination(params = {}, callback) ⇒ AWS.Request
Creates or updates a destination.
-
putDestinationPolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates an access policy associated with an existing destination.
-
putLogEvents(params = {}, callback) ⇒ AWS.Request
Uploads a batch of log events to the specified log stream.
The sequence token is now ignored in
PutLogEventsactions. -
putMetricFilter(params = {}, callback) ⇒ AWS.Request
Creates or updates a metric filter and associates it with the specified log group.
-
putQueryDefinition(params = {}, callback) ⇒ AWS.Request
Creates or updates a query definition for CloudWatch Logs Insights.
-
putResourcePolicy(params = {}, callback) ⇒ AWS.Request
Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53.
-
putRetentionPolicy(params = {}, callback) ⇒ AWS.Request
Sets the retention of the specified log group.
-
putSubscriptionFilter(params = {}, callback) ⇒ AWS.Request
Creates or updates a subscription filter and associates it with the specified log group.
-
startLiveTail(params = {}, callback) ⇒ AWS.Request
Starts a Live Tail streaming session for one or more log groups.
-
startQuery(params = {}, callback) ⇒ AWS.Request
Schedules a query of a log group using CloudWatch Logs Insights.
-
stopQuery(params = {}, callback) ⇒ AWS.Request
Stops a CloudWatch Logs Insights query that is in progress.
-
tagLogGroup(params = {}, callback) ⇒ AWS.Request
The TagLogGroup operation is on the path to deprecation.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource.
-
testMetricFilter(params = {}, callback) ⇒ AWS.Request
Tests the filter pattern of a metric filter against a sample of log event messages.
-
untagLogGroup(params = {}, callback) ⇒ AWS.Request
The UntagLogGroup operation is on the path to deprecation.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Removes one or more tags from the specified resource.
.
-
updateAnomaly(params = {}, callback) ⇒ AWS.Request
Use this operation to suppress anomaly detection for a specified anomaly or pattern.
-
updateDeliveryConfiguration(params = {}, callback) ⇒ AWS.Request
Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs.
-
updateLogAnomalyDetector(params = {}, callback) ⇒ AWS.Request
Updates an existing log anomaly detector.
.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.CloudWatchLogs(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.