mawk text-match count inconsistency
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mawk (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mawk
Hello all. I experienced a problem when I was trying to use a vanilla install of 9.10's mawk to process an Apache log file for a total count of 404's and 500 error's from field 9 of the log file. The log file's name is "access_log", and here is the code I ran:
mawk '$9 == 404 { count++ } END { print count }' access_log
mawk '$9 == 500 { count++ } END { print count }' access_log
Here is the requested information from the bug report's request:
1) I am using Ubuntu 9.10 Netbook Remix and on another machine, 9.10 Gnome (Regular).
2) The package version of mawk as reported by synaptic package manager is: 1.3.3-15-ubuntu.
3) I expected to get a result of 137 hits on field 9 for 500, 34167 hits for 404. This is what a friend of mine got (and I subsequently got) after running the same code under gawk 1:3.1.6.
4) Results were 58 hits for 500, and 19093 hits for 404 when using mawk.
I am fairly new to bug reporting, at least to Ubuntu, but I will try to do what I can to help.
Changed in mawk (Ubuntu): | |
status: | New → Fix Released |
Unless access_log is encoded in UTF-8 (a possibility), mawk and gawk should
give the same result for that pattern.