grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
24.03k stars 3.46k forks source link

parse error: invalid UTF-8 rune #3597

Closed loganmc10 closed 3 years ago

loganmc10 commented 3 years ago

Describe the bug I have log lines coming in formatted using logfmt. Some of the entries contain invalid characters. Loki refuses to do anything with the query. I was under the impression it would just skip parsing that line and add an __error__ label, rather than the query failing. The query works when I don't try to pass it through the logfmt parser.

To Reproduce Here is my query {hostname="my-hostname", job="traps_dev"} | logfmt

Here is the reply from the API (I tried the query in Grafana and using Postman, same response):

err while creating labelset for {community="my-string", host="my-string-string", hostname="my-string", jnxCmCfgChgEventDate_218="\a�\x04\t\x13\x184\x00+\x00\x00", jnxCmCfgChgEventLog_218="", jnxCmCfgChgEventSource_218="2", jnxCmCfgChgEventTime_218="2501301256", jnxCmCfgChgEventUser_218="username", job="traps_dev", mib="JUNIPER-CFGMGMT-MIB", name="jnxCmCfgChange", oid=".1.3.6.1.4.1.2636.4.5.0.1", snmpTrapEnterprise_0="jnxProductNameEXXRE", source="10.1.31.80", sysUpTimeInstance="2501301256", version="2c"}: 1:113: parse error: invalid UTF-8 rune

Expected behavior I expect that Loki would just skip parsing the line with the invalid characters and add a __error__ label

Environment: Grafana Cloud

loganmc10 commented 3 years ago

Sorry I'm realizing now that this is a duplicate of https://github.com/grafana/loki/issues/2859, I'll close this, however I think that other issue should be re-opened