Looking for suggestion to highlight system log

Anyone got idea on how to highlight log files like linux syslog?

Aug 23 00:02:02 example.com postfix/smtpd[82]: connect from unknown[xxx.xxx.xxx.xxx]
Aug 23 00:02:02 example.com postfix/smtpd[84]: connect from unknown[xxx.xxx.xxx.xxx]
Aug 23 00:02:02 example.com postfix/smtpd[82]: lost connection after CONNECT from unknown[xxx.xxx.xxx.xxx]
Aug 23 00:02:02 example.com postfix/smtpd[82]: disconnect from unknown[xxx.xxx.xxx.xxx] commands=0/0
Aug 23 00:02:04 example.com postfix/smtpd[84]: warning: unknown[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication fai>
Aug 23 00:02:04 example.com postfix/smtpd[84]: disconnect from unknown[xxx.xxx.xxx.xxx] ehlo=1 auth=0/1 quit=1 commands=2/3
Aug 23 00:02:06 example.com postfix/smtpd[82]: connect from unknown[xxx.xxx.xxx.xxx]
Aug 23 00:02:07 example.com postfix/smtpd[82]: warning: unknown[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication fai>
Aug 23 00:02:07 example.com postfix/smtpd[82]: disconnect from unknown[xxx.xxx.xxx.xxx] ehlo=1 auth=0/1 quit=1 commands=2/3
Aug 23 00:02:09 example.com postfix/smtpd[84]: connect from unknown[xxx.xxx.xxx.xxx]
Aug 23 00:02:10 example.com postfix/smtpd[84]: warning: unknown[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication fai>
Aug 23 00:02:11 example.com postfix/smtpd[84]: disconnect from unknown[xxx.xxx.xxx.xxx] ehlo=1 auth=0/1 quit=1 commands=2/3
Aug 23 00:05:32 example.com postfix/anvil[86]: statistics: max connection rate 4/60s for (smtp:xxx.xxx.xxx.xxx) at Aug 23 00:02:09
Aug 23 00:05:32 example.com postfix/anvil[86]: statistics: max connection count 1 for (smtp:xxx.xxx.xxx.xxx) at Aug 23 00:02:02

I looked through the https://gohugo.io/content-management/syntax-highlighting/ , but seems they are all languages.

I am highlighting them with apache now, but doesn’t look too good.

Display will depend on the lexer (language) and the style setting in config.toml.

Try the cobol lexer with the rrt style (dark background):

Or the cobol lexer with the pygments style (light background):

image

1 Like

Thank you!! It look 10x better now :star_struck:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.