Keyword Highlighting

Hello, I currently have Loki logs being displayed in Grafana Log Panel. I was wondering if it is possible to highlight a particular log entry that contains specified keywords (i.e. denied, warning, etc.)?

Hi @irishjd ,

Have you tried a query like this with the Logs panel?

This will filter and then highlight the matched expression, but not the entire log line

Thanks, will definitely give this a try. Do you happen to know if I can make list of keywords (i.e. csv ) and have the query reference the entire key word list instead of just one key word at a time?

I’m not super fluent with LogQL but one solution would be to use regular expression matching in your log stream selector:

Thanks Matt. Unfortunately I am not very good with regex :wink: It’s probably time to learn it.

check out regex101.com. It’s an absolute lifesaver!

1 Like

Thanks, I appreciate the help!