Log panel or log explore with Elasticsearch data cannot show custom fields such as "logger name"

Post forwarded from: log panel or log explore with Elasticsearch data cannot show custom fields such as "logger name" · Issue #47428 · grafana/grafana · GitHub

What happened:
Hi thanks for the lib! When using log panel or log explore with Elasticsearch data, it cannot show custom fields such as “logger name”. I have tried to show the labels, but it says there are none. I have also tried to see whether I can specify some extra fields, without any solutions.

image
image

What you expected to happen:
see above

How to reproduce it (as minimally and precisely as possible):
just use grafana to visualize elasticsearch logs

Anything else we need to know?:
none

Environment:

  • Grafana version:latest
  • Data source type & version: es latest
  • OS Grafana is installed on:linux
  • User OS & Browser:chrome
  • Grafana plugins:es
  • Others:none

it’s hard to see from the screenshots included what would be expected to show in the logs panel for this case

Just show: (1) timestamp (2) logger name (3) log message

what is the mapping for your log index data in elasticsearch?

@timestamp, logger.level, message, logger.name, some.other.fields, etc

which fields have you configured in your elasticsearch datasource for this log index?

log level is configured to logger.level, and message is configured to message.