# SubstituteStringProperty

This processor matches a key's value against a regular expression and replaces all matches with a replacement string.

For more information about this processor including examples, see substituteString in the CloudWatch Logs User Guide.

- Source: [`aws-logs/lib/transformer.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-logs/lib/transformer.ts#L512)
- Type last changed: v2.207.0 · 24 Jul 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
const substituteStringProperty: logs.SubstituteStringProperty = {
  entries: [{
    from: 'from',
    source: 'source',
    to: 'to',
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs

substitute_string_property = logs.SubstituteStringProperty(
    entries=[logs.SubstituteStringEntryProperty(
        from="from",
        source="source",
        to="to"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;

SubstituteStringProperty substituteStringProperty = SubstituteStringProperty.builder()
        .entries(List.of(SubstituteStringEntryProperty.builder()
                .from("from")
                .source("source")
                .to("to")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;

var substituteStringProperty = new SubstituteStringProperty {
    Entries = new [] { new SubstituteStringEntryProperty {
        From = "from",
        Source = "source",
        To = "to"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

substituteStringProperty := &SubstituteStringProperty{
	Entries: []SubstituteStringEntryProperty{
		&SubstituteStringEntryProperty{
			From: jsii.String("from"),
			Source: jsii.String("source"),
			To: jsii.String("to"),
		},
	},
}
```

## Properties

- `entries`: [SubstituteStringEntryProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.SubstituteStringEntryProperty.html)[] (required) — An array of objects, where each object contains information about one key to match and replace.
