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

Csv header delimiter #370

Merged
merged 4 commits into from
Aug 4, 2021
Merged

Csv header delimiter #370

merged 4 commits into from
Aug 4, 2021

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Aug 4, 2021

Description of Changes

In rare situations, it can be useful to specify the delimiter being used in your config for the header field.

pipeline:
- type: file_input
  include: 
  - ./w3c.log
  start_at: beginning
- type: csv_parser
  delimiter: "+"
  header_delimiter: ","
  header: "date,method,path"
- type: stdout

A future PR will bring support for tab delimited CSV data. This means the config would require a tab delimited header value:

pipeline:
...
- type: csv_parser
  header: "date    method    path"
...

This can be awkward to configure. Allowing the header delimiter to be set removes this issue.

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Add a changelog entry (for non-trivial bug fixes / features)
  • CI passes

@djaglowski
Copy link
Member

Log Files Logs / Second CPU Avg (%) CPU Avg Δ (%) Memory Avg (MB) Memory Avg Δ (MB)
1 1000 1.4482819 -0.03454733 128.95932 +1.8857727
1 5000 5.1897917 +0.13803434 137.16487 +0.30900574
1 10000 10.017402 -0.36215496 144.26118 -3.732483
1 50000 52.37042 +2.7083778 173.73276 +2.962555
1 100000 98.4989 -1.4585571 238.77963 +1.1095123
10 100 1.9999961 +0.068983555 132.54553 -1.4644318
10 500 6.241409 +0.069132805 139.13792 +0.3184204
10 1000 11.896813 -0.39660358 148.96552 +1.5358276
10 5000 56.224354 +0.13727188 177.35493 -5.5091553
10 10000 107.07256 +0.99131775 226.19289 -1.7254791

@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #370 (f693703) into master (291404b) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #370      +/-   ##
==========================================
- Coverage   73.28%   73.22%   -0.05%     
==========================================
  Files         124      124              
  Lines        7974     7977       +3     
==========================================
- Hits         5843     5841       -2     
- Misses       1638     1643       +5     
  Partials      493      493              
Impacted Files Coverage Δ
operator/builtin/parser/csv/csv.go 98.11% <100.00%> (+0.11%) ⬆️
operator/builtin/input/file/file.go 79.06% <0.00%> (-1.57%) ⬇️
operator/builtin/output/forward/forward.go 60.49% <0.00%> (-1.23%) ⬇️
operator/builtin/output/newrelic/newrelic.go 72.73% <0.00%> (-0.83%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 291404b...f693703. Read the comment docs.

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Looks great

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.

2 participants