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

Support add_docker_metadata in Windows #7797

Closed
wflyer opened this issue Jul 30, 2018 · 1 comment · Fixed by #7844
Closed

Support add_docker_metadata in Windows #7797

wflyer opened this issue Jul 30, 2018 · 1 comment · Fixed by #7844
Labels
enhancement Filebeat Filebeat good first issue Indicates a good issue for first-time contributors :Processors

Comments

@wflyer
Copy link
Contributor

wflyer commented Jul 30, 2018

I'm trying to collect docker logs using filebeat in Windows, but I've found that it can't be done due to current limitation.

In the current master branch, source field is used to get docker container id of the log.

Since source field of docker logs in Windows looks like "C:\\ProgramData\\docker\\containers\\{{ docker container id }}\\{{ docker container id }}-json.log", the path can't be parsed because the separator is / (

)

I think it would be better to use func SplitList(path string) []string in path/filepath package rather than using extract_field processor to get the container id. Or, at least, the directory separator should be configurable.

@exekias
Copy link
Contributor

exekias commented Jul 30, 2018

Probably passing os.PathSeparator there would fix the issue

@exekias exekias added the good first issue Indicates a good issue for first-time contributors label Aug 1, 2018
ChrsMark added a commit to ChrsMark/beats that referenced this issue Aug 19, 2018
Right now the separator used to parse container's logpaths is "/",
which fails to parse paths on Windows systems. This is resolved
by using os.PathSeparator to identify the seperator of the runtime
system.

Signed-off-by: Chris Mark <[email protected]>
exekias pushed a commit that referenced this issue Aug 27, 2018
Right now the separator used to parse container's logpaths is "/",
which fails to parse paths on Windows systems. This is resolved
by using os.PathSeparator to identify the seperator of the runtime
system.

Signed-off-by: Chris Mark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Filebeat Filebeat good first issue Indicates a good issue for first-time contributors :Processors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants