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

Script requestToUsage.sh skips lines ending with zero, leading to wrong calculations #51

Open
vizzard opened this issue Mar 25, 2021 · 0 comments

Comments

@vizzard
Copy link

vizzard commented Mar 25, 2021

awk '!/0$/' $FILE > $OUTPUT

I assume the intention was to skip lines with zero transfer bytes when log format was keeping that data at the end of log line.
Even then, this would remove valid lines if byte number will just end with 0 but would be greater than 0, like 1234567890.

Log format changed since then and now request.log entry has user agent at the end. That field may still end with 0.
Examples: curl/7.29.0, Artifactory/7.12.6 71206900.

Easiest workaround is to replace awk command with:
cat $FILE > $OUTPUT
It will copy all the lines from request.log into CSV file without cutting anything and script remains functional.

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

No branches or pull requests

1 participant