Skip to content

Allow escaping "," in paths for tail input#2001

Closed
herrsebi wants to merge 1 commit into
fluent:masterfrom
herrsebi:patch-1
Closed

Allow escaping "," in paths for tail input#2001
herrsebi wants to merge 1 commit into
fluent:masterfrom
herrsebi:patch-1

Conversation

@herrsebi

Copy link
Copy Markdown

Currently there is no way to tail files that include a comma (,) in their file name. Switching to a neg-lookbehind regex should enable this.

@repeatedly

Copy link
Copy Markdown
Member

Could you show me the path example?

@herrsebi

herrsebi commented May 27, 2018

Copy link
Copy Markdown
Author

Sure: /tmp/test,dev.log would be a vaild file name on unix system. In windows environments, a long filename (longer than 8 chars) may also contain a comma. The tail input would interpret this a two files, /tmp/test and dev.log. With this PR you could escape this with a \ (in the config this would look like /tmp/test\\,dev.log)

@repeatedly

Copy link
Copy Markdown
Member

Hmm... support special case is not good for me.
How about using dummy's message like approach?

config_param :dummy, default: [{"message"=>"dummy"}] do |val|

For ',' or other special case, use path ["p,ath1", "path2"].
This approach keeps to support path path1,path2 string parameter with split(',').

@repeatedly repeatedly self-assigned this May 28, 2018
@repeatedly repeatedly added v1 enhancement Feature request or improve operations labels May 28, 2018
Signed-off-by: Sebastian Pleschko <sebastian.pleschko@gmail.com>

Added 'paths' config element to in_tail to allow for paths containing commas
@herrsebi

herrsebi commented Nov 2, 2018

Copy link
Copy Markdown
Author

I've added an alternative 'paths' config setting, that would allow the form of configuration that you mentioned previously.
So now it's either
path: "test.log, test2.log"
or
paths: ["test.log", "test2.log"]

The latter form can then also include commas.

@mkoerperriag

Copy link
Copy Markdown

Can I help somehow to get this further?

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.

3 participants