You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, in some lines, last symbol, the double quote in given example, was mystically eaten. For the line entirely in double quotes, both leading and tailing quotes are gone. String in single quotes and without any quotes, was parsed as expexted.
Additional info:
If I use %{HTTPD_COMBINEDLOG} instead of %{GREEDYDATA:log_line:string} in grok patterns, every correct Nginx combined log parsed ok, as expected.
The text was updated successfully, but these errors were encountered:
Note the quoted string value for the "msg" field in the input line. Also note the position of this field in the input line and particularly the double quote at the end of the line.
In the output line there are two issues. First, the "message" field is missing the second escaped double quote that goes with the "msg" field value. Second, the "message" field has not been parsed by the logfmt parser. I believe this is what is throwing a logfmt syntax error message in the telegraf log (unterminated quoted value). Accordingly, the parser processor ignores the line which explains why the parsed fields and tags do not appear in the output.
As the OP has described, I believe I have tracked this problem down and isolated it to the log lines that end with a double quote. Thus, the lines that end with msg="some text" are mangled and are missing the second escaped double quote. I have confirmed that any line from the input that ends without a double quote is properly parsed by the grok input data processor and passed along to the logfmt parser processor. This appears to be a bug and I think it is with the grok input data format.
Relevant telegraf.conf:
System info:
Steps to reproduce:
Create /tmp/telegraf.conf file given earlier
Create /tmp/test.log with following data:
Execute telegraf with
telegraf --config /tmp/telegraf.conf
Output would be something like this:
Expected behavior:
Every line must parsed and returned as-is.
Actual behavior:
As you can see, in some lines, last symbol, the double quote in given example, was mystically eaten. For the line entirely in double quotes, both leading and tailing quotes are gone. String in single quotes and without any quotes, was parsed as expexted.
Additional info:
If I use
%{HTTPD_COMBINEDLOG}
instead of%{GREEDYDATA:log_line:string}
in grok patterns, every correct Nginx combined log parsed ok, as expected.The text was updated successfully, but these errors were encountered: