Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out_file: Support placeholders in symlink_path parameter #2254

Merged
merged 1 commit into from
Feb 5, 2019

Conversation

repeatedly
Copy link
Member

Since v1, path parameter supports placeholders and it means multiple buffer files exist at the same time.
So hard to refer latest buffer file via symlink_path. To resolve this problem, support placeholders in symlink_path.
The drawback is lots of symlink are created when there are various tags/field.

Signed-off-by: Masahiro Nakagawa repeatedly@gmail.com

Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
@repeatedly repeatedly added v1 enhancement Feature request or improve operations labels Jan 7, 2019
@repeatedly repeatedly self-assigned this Jan 7, 2019
@repeatedly repeatedly requested a review from okkez January 17, 2019 11:23
@okkez
Copy link
Contributor

okkez commented Jan 18, 2019

The following configuration generates a path include placeholder like /tmp/logs/${tag}.
Is this behavior expected?

<source>
  @type dummy
  tag dummy1
</source>

<source>
  @type dummy
  tag dummy2
</source>

<match dummy*>
  @type file
  path /tmp/logs/${tag}
  symlink_path /tmp/logs/current-${tag}
  <buffer tag,time>
    @type file
    # path /tmp/logs/buffer
  </buffer>
</match>
$ tree /tmp/logs/
/tmp/logs/
├── ${tag}
│   ├── buffer.b57fb1dd96306dd0b308e094f7ec2228f.log
│   ├── buffer.b57fb1dd96306dd0b308e094f7ec2228f.log.meta
│   ├── buffer.b57fb1dd96339a870530991d4871cfe11.log
│   └── buffer.b57fb1dd96339a870530991d4871cfe11.log.meta
├── current-dummy1 -> /tmp/logs/${tag}/buffer.b57fb1dd96339a870530991d4871cfe11.log
└── current-dummy2 -> /tmp/logs/${tag}/buffer.b57fb1dd96306dd0b308e094f7ec2228f.log

@repeatedly
Copy link
Member Author

I missed the reply.

Is this behavior expected?

Yes. This patch doesn't touch actual buffer file.

@repeatedly
Copy link
Member Author

If no problem, I will merge the patch.

@okkez
Copy link
Contributor

okkez commented Feb 4, 2019

No problem, go ahead.

@repeatedly repeatedly merged commit e0ac111 into master Feb 5, 2019
@cosmo0920 cosmo0920 deleted the out_file-symlink-placeholders branch February 6, 2019 01:58
@cosmo0920 cosmo0920 restored the out_file-symlink-placeholders branch February 6, 2019 01:58
@repeatedly repeatedly deleted the out_file-symlink-placeholders branch February 26, 2019 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants