Hi Team,
Windows environment : Promtail,Loki and Grafana setup
i have setup promtail , loki and grafana dash for extracting the MSSQLserver logs . The logs were displaying on grafana dashboard as below
L o g i n f a i l e d f o r u s e r
Same here. Just started down the Loki track and this is one of the first issues I have found. We are a BIG SQL Server shop and these logs are fairly useless for searching
Apparently SQL Server Error logs are encoded in UTF-16LE (From Google Searching) Or OCS2-LE BOM (from Notepad++). Grafana Support mentioned changing it to UTF-8, but I don’t think we have the option to change the encoding for SQL Server Error Logs.
Or use a scripting language such as python to copy add recreate that file with desired encoding in another location in same location but different extension, I just did that and Loki dashboard looks fine. I just dont see why MS is saving it with such encoding
This is a running sql server that emits logs on a regular frequency. Not sure writing a bunch of wrappers to copy the file (or the current parts of the file) in realtime is practical. We run over 300 SQL Servers and I was looking to Grafana for log capture. I just want the grafana agent to support the encoding.
This is still an issue. Sucks to have to use regex to find “[fF].a.i.l.e.d”, but that is doable. The big issue is the display in either Log Explorer or the log panel. Just impossible to read with the character spaceing.
Sorry to revive this old topic, but, no, that commit did not fix things. Trying to specify “utf-16” or “utf-16le” results in the errorlog showing as Chinese characters.
Acc. to this, Promtail version 2.8.2 with the proper encoding specified in the scrap configs: block will render non-UTF-8 log files correctly in Loki version 2.8.0
If using Grafana Agent, an issue has been raised on 22-May-2023.