Grafana table - show object field as JSON

Hello everyone.

Help me, please!
In Elasticsearch, every document has a field object with nested fields. In Grafana, they are displayed like this:

"request" : {
      "headers" : {
        "accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
        "cache-control" : "max-age=0",
        "connection" : "keep-alive",
        "upgrade-insecure-requests" : "1",
        "accept-encoding" : "gzip, deflate",
        "user-agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0",
        "accept-language" : "en-US,en;q=0.5"

As you can see, Grafana expands nested fields to final keys:

But I need to display request.headers field content in the one column as JSON.

Is it possible?

1 Like

I also want to do something similar to this, but my object looks more like this:

          "shard_counts" : [
              "name" : "es-live-6",
              "shards" : 117
              "name" : "es-live-3",
              "shards" : 116
              "name" : "es-live-2",
              "shards" : 117
              "name" : "es-live-1",
              "shards" : 117
              "name" : "es-live-8",
              "shards" : 117

At the moment shard_counts in a table just shows as: [object Object],[object Object],[object Object],[object Object],[object Object]

How can we turn nested objects into a table of data?

Have you figured it out how to work with the list of object?

Unfortunately, I haven’t found a pretty solution yet.
Now I’m converting an object into text JSON on Logstash into a additional field, just for display.

This is bad because an additional field is being created.

I couldn’t display it in a table, but when I changed the display type to a Stat rather than a table then it worked.