CloudWatch Logs
Parity grade: A · SDK aws-sdk-go-v2/service/cloudwatchlogs@v1.89.3 · last audited 2026-10-07 (2bc650bf9)
Category: Management & Governance · View PARITY.md on GitHub · All Services
In-memory CloudWatch Logs with log groups and streams, Logs Insights queries, filters, deliveries, transformers and scheduled queries.
Quick start
bash
export AWS_ENDPOINT_URL=http://localhost:8000
aws logs create-log-group --log-group-name /myapp/application
aws logs create-log-stream --log-group-name /myapp/application \
--log-stream-name 2024/01/01/instance-1
aws logs put-log-events --log-group-name /myapp/application \
--log-stream-name 2024/01/01/instance-1 \
--log-events '[{"timestamp":1704067200000,"message":"App started"}]'
aws logs get-log-events --log-group-name /myapp/application \
--log-stream-name 2024/01/01/instance-1
aws logs filter-log-events --log-group-name /myapp/application --filter-pattern "ERROR"
aws logs put-retention-policy --log-group-name /myapp/application --retention-in-days 30Supported operations
| Area | Operations |
|---|---|
| Groups and streams | CreateLogGroup, DeleteLogGroup, DescribeLogGroups, ListLogGroups, CreateLogStream, DeleteLogStream, DescribeLogStreams, PutLogGroupDeletionProtection, AssociateKmsKey, DisassociateKmsKey |
| Events | PutLogEvents, GetLogEvents, FilterLogEvents, GetLogRecord, GetLogObject, StartLiveTail |
| Retention and tags | PutRetentionPolicy, DeleteRetentionPolicy, TagLogGroup, UntagLogGroup, ListTagsLogGroup, TagResource, UntagResource, ListTagsForResource |
| Logs Insights | StartQuery, GetQueryResults, StopQuery, DescribeQueries, GetLogGroupFields, GetLogFields, ListLogGroupsForQuery, Put/Describe/DeleteQueryDefinition |
| Scheduled queries | Create/Get/Update/Delete/ListScheduledQuery, GetScheduledQueryHistory |
| Metric filters | PutMetricFilter, DescribeMetricFilters, DeleteMetricFilter, TestMetricFilter |
| Subscription filters | PutSubscriptionFilter, DescribeSubscriptionFilters, DeleteSubscriptionFilter |
| Export and import | CreateExportTask, DescribeExportTasks, CancelExportTask, CreateImportTask, DescribeImportTasks, DescribeImportTaskBatches, CancelImportTask |
| Deliveries | delivery sources, destinations, destination policies, CreateDelivery, GetDelivery, DescribeDeliveries, DeleteDelivery, UpdateDeliveryConfiguration |
| Cross-account destinations | PutDestination, PutDestinationPolicy, DescribeDestinations, DeleteDestination |
| Account and resource policies | Put/Describe/DeleteAccountPolicy, Put/Describe/DeleteResourcePolicy |
| Data protection and indexing | Put/Get/DeleteDataProtectionPolicy, Put/Describe/DeleteIndexPolicy, DescribeFieldIndexes, DescribeConfigurationTemplates |
| Transformers | PutTransformer, GetTransformer, DeleteTransformer, TestTransformer |
| Anomaly detection | CreateLogAnomalyDetector, GetLogAnomalyDetector, ListLogAnomalyDetectors, UpdateLogAnomalyDetector, DeleteLogAnomalyDetector, ListAnomalies, UpdateAnomaly |
| Integrations | PutIntegration, GetIntegration, ListIntegrations, DeleteIntegration, S3 table integration source association |
| Lookup tables | Create/Get/Update/Delete/DescribeLookupTable(s) |
| Other | PutSyslogConfiguration, ListSyslogConfigurations, DeleteSyslogConfiguration, Get/PutStorageTierPolicy, PutBearerTokenAuthentication, ListAggregateLogGroupSummaries |
Configuration
| Env | Default | Purpose |
|---|---|---|
CLOUDWATCHLOGS_JANITOR_INTERVAL | 1m | Janitor tick |
CLOUDWATCHLOGS_MAX_RETENTION_DAYS | 14 | Retention for groups with no retention policy |
Differences from AWS
WARNING
Retention is enforced. The janitor deletes events past the group's retentionInDays. A group with no policy keeps events for CLOUDWATCHLOGS_MAX_RETENTION_DAYS (14 by default), where AWS keeps them forever.
- Logs Insights runs the Logs Insights QL engine only.
QueryLanguageSQL and PPL are not honoured. - Anomaly
Histogram,LogSamples,PatternStringandPatternTokensare never derived from log content: there is no pattern-detection engine. IncludeLinkedAccountshas no effect (no cross-account links).DataSources,FieldIndexNamesandLogGroup.DataProtectionStatusare not modelled.DescribeConfigurationTemplatesandDescribeFieldIndexesalways return an empty list.- Scheduled query runs do not simulate delivery, so
Destinationsis always empty. DeliverySource.StatusandStatusReasonare not modelled.- S3 table integration associations are all top-level and
ACTIVE.
Parity & Coverage
| Metric | Value |
|---|---|
| PARITY entries audited | 86 (86 ok) |
| Feature families | 12 (12 ok) |
| Known gaps | none |
| Structural gaps (can't be emulated) | 9 |
| Deferred items | 0 |
| Resource leaks | clean |
Structural Gaps
These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.
- Anomaly Histogram/LogSamples/PatternString/PatternTokens are populated only via the AddAnomalyInternal seam: no pattern-detection ML engine exists to derive them from log content.
- IncludeLinkedAccounts (no cross-account link model), DataSources/FieldIndexNames (no field-indexing engine) and LogGroup.DataProtectionStatus/InheritedProperties are not modeled; aggregate Limit is moot with a single bucket.
- ScheduledQueryDestination.ProcessedIdentifier and its nested type are unmodeled: scheduled query runs do not simulate destination delivery, so Destinations is always empty.
- DeliverySource.Status/StatusReason are not modeled: RESOURCE_DELETED needs cross-service resource-deletion tracking.
- DescribeConfigurationTemplates (AWS's static template catalog) and DescribeFieldIndexes (needs a field-indexing engine) are empty-list void-results; no create op backs either.
- S3TableIntegrationSource ParentSourceIdentifier/StatusReason are not modeled: no nested/derived associations or health-check failure path, so every association is a top-level ACTIVE entry.
- StartQuery.QueryLanguage SQL/PPL is not honoured: only the Logs Insights QL engine exists.
- StartLiveTail streaming transport: the real op is a Smithy event stream this unary handler cannot emulate; validation-only by design.
- Import tasks: ImportStatistics/ErrorMessage and DescribeImportTaskBatches execution state need a real external-source import engine.
Audited Operations
86 audited operations
| Operation | Wire | Errors | State | Persist |
|---|---|---|---|---|
CreateLookupTable | fixed | ok | fixed | ok |
GetLookupTable | ok | ok | ok | ok |
UpdateLookupTable | fixed | ok | fixed | ok |
DeleteLookupTable | ok | ok | ok | ok |
DescribeLookupTables | fixed | ok | fixed | ok |
PutSyslogConfiguration | ok | ok | ok | ok |
ListSyslogConfigurations | ok | ok | ok | ok |
DeleteSyslogConfiguration | ok | ok | ok | ok |
GetStorageTierPolicy | ok | ok | ok | ok |
PutStorageTierPolicy | ok | ok | ok | ok |
PutLogEvents | ok | ok | ok | ok |
GetLogEvents | ok | ok | ok | ok |
FilterLogEvents | fixed | fixed | fixed | n/a |
GetLogGroupFields | ok | ok | ok | n/a |
GetLogFields | ok | ok | ok | n/a |
GetLogRecord | fixed | ok | fixed | n/a |
CreateLogGroup | ok | ok | ok | ok |
DeleteLogGroup | ok | ok | ok | ok |
DescribeLogGroups | ok | ok | ok | ok |
ListLogGroups | fixed | ok | fixed | ok |
ListAggregateLogGroupSummaries | fixed | fixed | ok | n/a |
CreateLogStream | ok | ok | ok | ok |
DeleteLogStream | ok | ok | ok | ok |
DescribeLogStreams | ok | ok | ok | ok |
PutLogGroupDeletionProtection | ok | ok | ok | ok |
PutRetentionPolicy | ok | ok | ok | ok |
DeleteRetentionPolicy | ok | ok | ok | ok |
PutSubscriptionFilter | ok | ok | ok | ok |
DescribeSubscriptionFilters | ok | ok | ok | ok |
DeleteSubscriptionFilter | ok | ok | ok | ok |
PutMetricFilter | ok | ok | ok | ok |
DescribeMetricFilters | ok | ok | fixed | ok |
DeleteMetricFilter | ok | ok | ok | ok |
TestMetricFilter | ok | ok | ok | n/a |
ListTagsLogGroup | ok | ok | ok | ok |
ListTagsForResource | ok | ok | ok | ok |
TagLogGroup | ok | ok | ok | ok |
UntagLogGroup | ok | ok | ok | ok |
TagResource | ok | ok | ok | ok |
UntagResource | ok | ok | ok | ok |
CreateExportTask | ok | ok | ok | ok |
DescribeExportTasks | ok | ok | ok | ok |
CancelExportTask | ok | ok | ok | ok |
CreateImportTask | ok | ok | ok | ok |
DescribeImportTasks | ok | ok | ok | ok |
CancelImportTask | ok | ok | ok | ok |
PutDestination | ok | ok | ok | ok |
DescribeDestinations | ok | ok | ok | ok |
DeleteDestination | ok | ok | ok | ok |
PutDestinationPolicy | ok | ok | ok | ok |
PutDeliveryDestination | ok | ok | ok | ok |
GetDeliveryDestination | ok | ok | ok | ok |
DescribeDeliveryDestinations | fixed | ok | ok | ok |
DeleteDeliveryDestination | ok | ok | ok | ok |
PutDeliveryDestinationPolicy | ok | ok | ok | ok |
GetDeliveryDestinationPolicy | ok | ok | ok | ok |
DeleteDeliveryDestinationPolicy | ok | ok | ok | ok |
PutDeliverySource | ok | ok | ok | ok |
GetDeliverySource | ok | ok | ok | ok |
DescribeDeliverySources | fixed | ok | ok | ok |
DeleteDeliverySource | ok | ok | ok | ok |
CreateLogAnomalyDetector | ok | ok | ok | ok |
GetLogAnomalyDetector | ok | ok | ok | ok |
ListLogAnomalyDetectors | ok | ok | ok | ok |
UpdateLogAnomalyDetector | ok | ok | ok | ok |
DeleteLogAnomalyDetector | ok | ok | ok | ok |
ListAnomalies | fixed | ok | ok | ok |
UpdateAnomaly | fixed | ok | fixed | ok |
CreateScheduledQuery | ok | ok | ok | ok |
GetScheduledQuery | ok | ok | ok | ok |
ListScheduledQueries | ok | ok | ok | ok |
UpdateScheduledQuery | fixed | ok | fixed | ok |
DeleteScheduledQuery | ok | ok | ok | ok |
GetScheduledQueryHistory | fixed | ok | ok | ok |
PutResourcePolicy | fixed | ok | fixed | ok |
DescribeResourcePolicies | fixed | ok | fixed | ok |
DeleteResourcePolicy | fixed | ok | fixed | ok |
PutIndexPolicy | fixed | fixed | fixed | ok |
DescribeIndexPolicies | fixed | fixed | fixed | n/a |
PutQueryDefinition | fixed | ok | ok | ok |
DescribeQueryDefinitions | fixed | ok | ok | ok |
DisassociateSourceFromS3TableIntegration | fixed | fixed | fixed | ok |
AssociateSourceToS3TableIntegration | fixed | ok | fixed | ok |
ListSourcesForS3TableIntegration | fixed | fixed | fixed | n/a |
GetDataProtectionPolicy | fixed | ok | ok | ok |
DescribeAccountPolicies | ok | ok | fixed | ok |
Audited Feature Families
| Feature Family | Status |
|---|---|
metric-filter-emission | ok |
metric-filter-patterns-and-defaults | ok |
janitor-retention-sweep | ok |
subscription-filter-delivery | ok |
insights (StartQuery/GetQueryResults/StopQuery/DescribeQueries/query language) | ok |
export/import tasks / deliveries / anomaly detectors / scheduled queries | ok |
account policies / data protection/resource/index policies / transformers / integrations | ok |
PutIntegration | — |
PutBearerTokenAuthentication | — |
StartLiveTail | ok |
lookup tables / syslog configurations / storage tier policy (parity-4 SDK-bump additions) | ok |
pagination_sweep | fixed |
