alecthomas / chroma

A general purpose syntax highlighter in pure Go
MIT License
4.33k stars 395 forks source link

support linux syslog files #989

Open iameru opened 1 month ago

iameru commented 1 month ago

Is there an existing issue for this?

What problem does this feature solve?

would be nice to have a support for syslogs. for example

2024-08-06t11:47:04+02:00 mashine321 sshd[275870]: disconnected from authenticating user root 222.123.222.123 port 23398 [preauth]
2024-08-06t11:47:08+02:00 mashine321 sshd[275870]: received disconnect from 222.123.222.123 port 23398:11:  [preauth]
2024-08-06t11:51:38+02:00 mashine321 sshd[275888]: connection closed by authenticating user root 123.9.123.9 port 33638 [preauth]
2024-08-06t11:53:39+02:00 web1 wordpress(www.example.com authentication failure for megauser from 123.123.123.123
2024-08-06t11:55:00+02:00 mashine123 cron[275909]: pam_unix(cron:session): session closed for user 3v1lh4xx

What feature do you propose?

highlight time, hostname, applicationname, PID, message of syslog. in the log message afterwards, numbers could be highlighted slightly different to letters.

We use chroma a lot to highlight code we share. We share logs aswell and it would help with big chunks of text to have some highlighting.