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

[Filebeat][elasticsearch] fix JSON lines picked up in gc.logs #13165

Closed
wants to merge 1 commit into from

Conversation

kesslerm
Copy link
Contributor

@kesslerm kesslerm commented Aug 2, 2019

When used with docker autodiscover, the elasticsearch gc module
erroneously picks up JSON formatted line from docker's stdout.

Fix by excluding lines that start with {.

Fixes #13164

When used with docker autodiscover, the elasticsearch gc module
erroneously picks up JSON formatted line from docker's stdout.

Fix by excluding lines that start with `{`.
@kesslerm kesslerm requested a review from a team as a code owner August 2, 2019 12:34
@ycombinator ycombinator self-assigned this Aug 5, 2019
@ycombinator
Copy link
Contributor

Hi @kesslerm, thanks again for your contribution.

Could you add a XXXX.log file showing log entries in a Docker environment and a corresponding XXXX.log-expected.json file showing the expected parsed event JSONs (should be only for the GC log entries in XXXX.log)? BTW, the XXXX is meant to be a placeholder — feel free to replace it with a descriptive filename as you see fit.

The easiest way to do this would be to capture a few lines from the Docker container log, containing both GC and non-GC log entries, and pasting them in the XXXX.log file. Then run the following commands to generate the XXXX.log-expected.json file.

cd $GOPATH/src/go/src/github.com/elastic/beats/filebeat
. build/python-env/bin/activate
rm -rf build/system-tests/*
GENERATE=1 INTEGRATION_TESTS=1 TESTING_FILEBEAT_MODULES=elasticsearch TESTING_FILEBEAT_FILESETS=gc nosetests -v --nocapture tests/system/test_modules.py

This will also help ensure that the changes in the PR don't break any other tests — if they do, then other *.expected.json files will also get regenerated for the elasticsearch/gc fileset, which should not happen.

Hope that makes sense and helps. Feel free to ask questions, of course!

@cachedout cachedout removed the request for review from a team October 28, 2019 10:39
@dedemorton dedemorton added docs and removed docs labels Feb 19, 2020
@ycombinator
Copy link
Contributor

Hey @kesslerm, is this something you wanted to continue working on? If so, please see my previous comment. Thanks!

@ycombinator
Copy link
Contributor

Hi @kesslerm, I've taken your commit and included it my PR, which also includes test files: #17164. Thanks for your contribution. Closing this PR now in favor of #17164.

@ycombinator ycombinator deleted the fixes/13164 branch March 20, 2020 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat][elasticsearch][gc] picking up wrong logs with docker autodiscover
3 participants