-
Notifications
You must be signed in to change notification settings - Fork 74
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 ltsv #363
Support ltsv #363
Conversation
* The many nginx's users choice the log format into Labeled Tab Separated Values to be able to analyze and extend logs more easily. * So, it should be support this format that the user can be more easily to switch from conventional log collector to nginx-agent.
✅ Deploy Preview for agent-public-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a failing unit test that needs to be addressed when you get a chance. https://github.com/nginx/agent/actions/runs/5437056592/jobs/9899420232
src/core/tailer/tailer.go
Outdated
@@ -95,6 +101,28 @@ func NewPatternTailer(file string, patterns map[string]string) (*PatternTailer, | |||
return &PatternTailer{t, gc}, nil | |||
} | |||
|
|||
func NewLTSVTailer(file string) (*LTSVTailer, error) { | |||
ltsvParseString := func(line string) map[string]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this out into its own function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhurley I could move out the parse function outside.
src/core/tailer/tailer.go
Outdated
func NewLTSVTailer(file string) (*LTSVTailer, error) { | ||
ltsvParseString := func(line string) map[string]string { | ||
columns := strings.Split(line, "\t") | ||
lvs := make(map[string]string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what lvs and lv mean. Could you give the variables more meaningful names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhurley Also Fix those name.
Sorry my bad, some of checksum and line count hadn’t fixed. l’ve already fixed |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
==========================================
+ Coverage 67.13% 67.25% +0.11%
==========================================
Files 113 113
Lines 12748 12792 +44
==========================================
+ Hits 8559 8603 +44
+ Misses 3616 3613 -3
- Partials 573 576 +3
☔ View full report in Codecov by Sentry. |
Proposed changes
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the supported keywords here in this description (not in the title of the PR).
* So, it should be support this format that the user can be more easily to switch from conventional log collector to nginx-agent.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentmake install-tools
and have attached any dependency changes to this pull requestREADME.md
)