lnav
lnav copied to clipboard
Colors and Highlighting messed up on v0.10.0 (CentOS 7)
lnav version v0.10.0
Describe the bug
Colors are messed up. Screenshots:
(monocai)
(default)
The white highlighted portion is supposed to be syntax colored as an "identifier". It works as expected in lnav 0.9.0.
v0.9.0 has been working fine for me but I ran into a weird bug so I decided to upgrade. Will be filing a bug report for the (unrelated) 0.9.0 issue as well.
Would you be able to send me the log format file and some sample log messages to help debug this? You can send to [email protected] if you don't want to post here.
Some example lines:
Wed Sep 22 20:47:43.520 COMPONENT NOTICE UPDATE INFO : time: 1632317468747827000, seq_num: 267506
Wed Sep 22 20:47:43.520 COMPONENT2 NOTICE UPDATE INFO : time: 1632317468747827000, seq_num: 267506
Wed Sep 22 20:47:43.520 COMPONENT NOTICE UPDATE INFO : time: 1632317468776380000, seq_num: 267523
Wed Sep 22 20:47:43.520 COMPONENT3 NOTICE UPDATE INFO : time: 1632317468776380000, seq_num: 267523
Wed Sep 22 20:47:44.519 COMPONENT2 NOTICE UPDATE INFO : time: 1632317469322274000, seq_num: 374094
Wed Sep 22 20:47:44.519 COMPONENT NOTICE UPDATE INFO : time: 1632317469322274000, seq_num: 374094
Wed Sep 22 20:47:44.521 COMPONENT NOTICE UPDATE INFO : time: 1632317469322207623, seq_num: 23358843
Wed Sep 22 20:47:44.521 COMPONENT NOTICE UPDATE INFO : time: 1632317469322207623, seq_num: 23358843
Wed Sep 22 20:47:44.753 COMPONENT3 NOTICE UPDATE INFO : time: 1632317469437933017, seq_num: 23364569
Wed Sep 22 20:47:44.754 COMPONENT NOTICE UPDATE INFO : time: 1632317469437933017, seq_num: 23364569
Wed Sep 22 20:47:44.755 COMPONENT2 NOTICE UPDATE INFO : time: 1632317469438165000, seq_num: 374175
Wed Sep 22 20:47:44.755 COMPONENT NOTICE UPDATE INFO : time: 1632317469438165000, seq_num: 374175
Wed Sep 22 20:47:44.757 COMPONENT NOTICE UPDATE INFO : time: 1632317469438167000, seq_num: 268639
Wed Sep 22 20:47:44.757 COMPONENT2 NOTICE UPDATE INFO : time: 1632317469438167000, seq_num: 268639
Wed Sep 22 20:47:44.775 COMPONENT2 NOTICE UPDATE INFO : time: 1632317469444932807, seq_num: 23364819
Wed Sep 22 20:47:44.775 COMPONENT NOTICE UPDATE INFO : time: 1632317469444932807, seq_num: 23364819
Wed Sep 22 20:47:44.775 COMPONENT3 NOTICE UPDATE INFO : time: 1632317469448162000, seq_num: 374177
Wed Sep 22 20:47:44.775 COMPONENT NOTICE UPDATE INFO : time: 1632317469448162000, seq_num: 374177
Wed Sep 22 20:47:44.780 COMPONENT3 NOTICE UPDATE INFO : time: 1632317469448161000, seq_num: 268655
Wed Sep 22 20:47:44.780 COMPONENT2 NOTICE UPDATE INFO : time: 1632317469448161000, seq_num: 268655
Format file:
{
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
"example_log" : {
"title" : "example log",
"regex" : {
"basic" : {
"pattern" : "^(?<timestamp>\\S{3} \\S{3} \\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})\\s*(?<component>\\S+)\\s*(?<level>\\w+)\\s*(?<body>(.*time: (?<time>\\d{19}).*|.*))$"
}
},
"level-field" : "level",
"level" : {
"error" : "ERROR",
"warning" : "WARNING",
"stats": "NOTICE",
"info": "INFO",
"debug": "DEBUG"
},
"value" : {
"component" : {
"kind" : "string",
"identifier" : true
},
"time" : {
"kind" : "string",
"identifier" : false,
"rewriter" : ";SELECT datetime(substr(:time,1,10), 'unixepoch')"
}
},
"timestamp-format" : [ "%a %b %e %H:%M:%S.%L" ]
}
}
When I parse this as an example log, the same thing happens, so I don't think it's my format file:

Expected behavior (v0.9.0):

Edit: The problem is on an AWS CentOS7 instance. I tried on my local CentOS 7 WSL and I am not seeing the issue. Very strange. Since this is a color issue, could it have something to do with the $TERM variable?
Edit2: YUP. Seeing the same problem on CentOS 7 WSL when $TERM = xterm instead of xterm-256color
I used to have it set to xterm-256color but it was giving me vim problems (no idea why but setting it to just xterm fixed it).
What terminal emulator are you using (xterm, gnome-terminal, ...) ?
I'm experiencing a similar issue but getting characters like this and no colors at all:
/▒⎺└e/b⎼␋▒┼/╚⎺c┤└e┼├⎽/S┤⎻⎻⎺⎼├/┏O┳╬S/╔▒⎽e↑▮▮348565/┐8⎽/c⎺┼├▒␋┼e⎼┌⎺±⎽/┐┤be┌e├
/▒⎺└e/b⎼␋▒┼/╚⎺c┤└e┼├⎽/S┤⎻⎻⎺⎼├/┏O┳╬S/╔▒⎽e↑▮▮348565/┐8⎽/c⎺┼├▒␋┼e⎼┌⎺±⎽/┐┤be↑c⎺┼├⎼⎺┌┌e⎼↑└▒┼▒±e
I am using lnav 0.10.1 Terminator and running SLES 15.4 Static download
I fixed this by meeting the documentations recommendation: export TERM=xterm-256color
@stefan123t That fixed the issue thank you!