diff --git a/pkg/sdk/model/output/s3.go b/pkg/sdk/model/output/s3.go index c55db0b4a..3a99a358b 100644 --- a/pkg/sdk/model/output/s3.go +++ b/pkg/sdk/model/output/s3.go @@ -127,8 +127,8 @@ type S3OutputConfig struct { GrantFullControl string `json:"grant_full_control,omitempty"` // The length of `%{hex_random}` placeholder(4-16) HexRandomLength string `json:"hex_random_length,omitempty"` - // The format of S3 object keys (default: %{path}%{time_slice}_%{index}.%{file_extension}) - S3ObjectKeyFormat string `json:"s3_object_key_format,omitempty"` + // The format of S3 object keys (default: %{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension}) + S3ObjectKeyFormat string `json:"s3_object_key_format,omitempty" plugin:"default:%{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension}"` // S3 bucket name S3Bucket string `json:"s3_bucket"` // Archive format on S3 diff --git a/pkg/sdk/model/output/s3_test.go b/pkg/sdk/model/output/s3_test.go index b8bb50351..5c763d878 100644 --- a/pkg/sdk/model/output/s3_test.go +++ b/pkg/sdk/model/output/s3_test.go @@ -39,6 +39,7 @@ buffer: @id test path logs/${tag}/%Y/%m/%d/ s3_bucket logging-amazon-s3 + s3_object_key_format %{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension} s3_region eu-central-1 @type file diff --git a/pkg/sdk/model/render/fluent_test.go b/pkg/sdk/model/render/fluent_test.go index b9c58acf0..abc8d4c8d 100644 --- a/pkg/sdk/model/render/fluent_test.go +++ b/pkg/sdk/model/render/fluent_test.go @@ -479,6 +479,7 @@ func TestRenderS3(t *testing.T) { @id test path /var/buffer s3_bucket test_bucket + s3_object_key_format %{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension} @type file path asd @@ -502,6 +503,7 @@ func TestRenderS3(t *testing.T) { @id test path /var/buffer s3_bucket test_bucket + s3_object_key_format %{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension} `, }, @@ -519,6 +521,7 @@ func TestRenderS3(t *testing.T) { @id test path /var/buffer s3_bucket test_bucket + s3_object_key_format %{path}%{time_slice}_%{uuid_hash}_%{index}.%{file_extension} path e profile_name f