fluent-plugin-s3 icon indicating copy to clipboard operation
fluent-plugin-s3 copied to clipboard

Placeholder replacement order

Open tgilman opened this issue 3 years ago • 2 comments

Describe the bug

Unable to use placeholder values within interpolation expression for path property.

Example: path "#{'eye.test'.sub('.', '/') + '${tag}'.sub('.', '/')}/%Y-%m-%d/" ${tag} = 'his.blahbalh'

results in 'eye/testhis.blahblah' because the ${tag} placeholder replacement doesn't happen until after the outer #{} interpolation has already executed.

To Reproduce

See path value above.

Expected behavior

Shouldn't placeholder replacement happen prior to evaluating the resulting string?

Your Environment

- Fluentd version:
- TD Agent version:
- fluent-plugin-s3 version:
- aws-sdk-s3 version:
- aws-sdk-sqs version:
- Operating system:
- Kernel version:

Your Configuration

  <store>
	@type s3 #send logs to s3 for longterm storage
	s3_bucket fluend-poc
	s3_region us-west-2
	path "#{'eye.test'.sub('.', '/') + '${tag}'.sub('.', '/')}/%Y-%m-%d/"
	<buffer tag,time>
    @type file
    path /var/log/fluent/s3
    timekey 60 #900 # 15 min partition
    timekey_wait 1m
    timekey_use_utc true # use utc
    chunk_limit_size 256m
  </buffer>
  </store>

Your Error Log

No errors produced

Additional context

No response

tgilman avatar Mar 14 '22 18:03 tgilman

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

github-actions[bot] avatar Jun 13 '22 10:06 github-actions[bot]

This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days

github-actions[bot] avatar Sep 13 '22 10:09 github-actions[bot]

This issue was automatically closed because of stale in 30 days

github-actions[bot] avatar Dec 30 '22 10:12 github-actions[bot]