Short answer:
I found that there isn't such UI function in Grafana UI.
But there's two features that can help you achieve such result:
- Line formating - allows you to show only selected parts of message
- ANSI escape sequence rendering - that allows you to change font settings (bold/italic/color)
Long answer:
- Here's my initial test query (that shows only messages that have "HornetQ")
{appname=~".+"} |= "HornetQ"
it produces following output.
- I have added line formatting to the query to show only message field by default
{appname=~".+"} |= "HornetQ"
| json
| line_format "{{ .message }}"
But if you would open message details you would see all json fields anyway
- Let's add modify line format to show preview of extra fields on separate line.
We would use pattern '<_entry>'
to save initial json for further processing. Also we would use gotpl loop in line_format
and if
that would skip message field
{appname=~".+"} |= "HornetQ"
| pattern `<_entry>`
| json
| line_format "{{ .message }}\n{{ range $k, $v := (fromJson ._entry)}}{{if ne $k \"message\"}}{{$k}}: {{$v}} {{ end }}{{ end }}"
- Let's make our messages better readable by changing font options.
To achieve that we would use ANSI escape sequences (additional info)
{appname=~".+"}
| pattern `<_entry>`
| json
| line_format "\033[1;37m{{ .message }}\033[0m\n{{ range $k, $v := (fromJson ._entry)}}{{if ne $k \"message\"}}\033[1;30m{{$k}}: \033[0m\033[2;37m{{$v}}\033[0m {{ end }}{{ end }}"
You can see that |= "HornetQ"
part is missing in last query, that because it breaks last query (with colouring), so I skip it.
P.S. So for now my solution doesn't work with fulltext search :(