JSON View sometimes won't let empty cells stay empty

I have a table in Grafana (version 7.3.7) that uses an Elastic Search data source. Two of the columns contain rather lengthy values sometimes (sometimes they’re short, sometimes they’re empty).

I want to make it so that users can inspect these cells when needed but otherwise I’m fine with their content not fully showing. That is, a narrow column is fine, but I want the full value to be able to show up on mouseover, or a similar approach.

I have noticed that using an override for these columns and changing the display mode to JSON View does the trick.

However, for one of the columns, empty cells are also transformed.

The column I am happy with is called message and it contains either empty strings or strings representing JSON objects.

The other column is actually sets of strings I feed into ES, but ES transforms them into strings. These strings now look like comma-separated values, i.e. 7,foo,45,bar or sometimes foo:45,bar:baz .

These look alright in JSON View mode, particularly when hovered over. For empty strings, however, the end result looks like such: [""] . I don’t understand why this is and I haven’t been able to stop this from happening, without going to the source and altering the data itself.

Note: I want to keep these lines, I just want the cells to be empty, rather than have this “list of empty string” look.

Hi @estomagordo,

It looks like handling empty strings in JSON (or its lack of support for that) is a large topic.

There are also some recent PRs related to this issue.

This topic was automatically closed after 365 days. New replies are no longer allowed.