Escaping backslash for logs collection with Docker compose #3423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
After several tests, it appears that when building containers using docker-compose with the documentation pattern (
"\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
), no logs whatsoever are coming in.According to Nils:
This was tested with Postgresql logs, that do not start with a timestamp:
"\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
as regex pattern, no logs at all are coming in"\\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
as regex pattern, logs are coming in"foo"
as regex pattern, logs are coming inIt was also tested with Nginx logs, that do start with a timestamp
"\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
as regex pattern, no logs at all are coming in"\\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])"
as regex pattern, logs are coming inI performed several other tests that seem to converge toward this same conclusion but I could definitely use a double check by someone else.
Customer ended up with this conclusion as well:
More details about this on this Slack convo:
https://dd.slack.com/archives/C6QR6DXJ4/p1540287215000100
https://cl.ly/c48752cc034f
Motivation
Preview link
Additional Notes