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

Add JSON log parser #179

Merged
merged 6 commits into from
Feb 25, 2021

Conversation

yngwiewang
Copy link
Contributor

[FEATURE] Add JSON parser to support JSON log files
Fixes: #793

I've made various changes:

Bump the Go version to 1.13 in Dockerfile
Add a new flag and config-file argument "-parser"
Abstract a generic Parser interface
Provide two implementations of Parser interface: plain text parser TestParser and JSON parser JsonParser

Very welcome to propose improvements to the code.

@martin-helmich
Copy link
Owner

Thanks for the PR! As already said, 👍 on the general design. Will review in detail ASAP.

Copy link
Owner

@martin-helmich martin-helmich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long. A big 👍 in general on this change; I've just added a few notes and thoughts -- let me know what you think. ;)

README.adoc Outdated Show resolved Hide resolved
parser/parser.go Show resolved Hide resolved
main.go Show resolved Hide resolved
parser/jsonparser/jsonparser.go Outdated Show resolved Hide resolved
parser/jsonparser/jsonparser_test.go Show resolved Hide resolved
parser/jsonparser/jsonparser_test.go Outdated Show resolved Hide resolved
yngwiewang and others added 4 commits February 23, 2021 17:29
Fixed some grammatical errors.

Co-authored-by: Martin Helmich <[email protected]>
Use the assertions of testify package.

Co-authored-by: Martin Helmich <[email protected]>
Optimize performance.

Co-authored-by: Martin Helmich <[email protected]>
Use the testify package.
@yngwiewang
Copy link
Contributor Author

I'm not a GitHub expert. I should also modify textparser_test.go and loader_flags.go. Should I make all the modifications above in my local repo and commit once and push again, or some other operations? Please give me some advice.

@martin-helmich
Copy link
Owner

Should I make all the modifications above in my local repo and commit once and push again, or some other operations? Please give me some advice.

Just commit as it is most convenient for you 😄 -- I'll probably squash the entire branch into a single commit when merging, anyway, so you don't need to do any Git history rewrites or any such things before pushing.

2. Use testify package in parser/*._test file.
@codeclimate
Copy link

codeclimate bot commented Feb 24, 2021

Code Climate has analyzed commit 4348122 and detected 0 issues on this pull request.

View more on Code Climate.

@martin-helmich martin-helmich merged commit b033474 into martin-helmich:master Feb 25, 2021
@yngwiewang yngwiewang deleted the feature-jsonparser branch February 26, 2021 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON File Support
2 participants