Loki does not parse embedded list in json. There are some other logging platforms that can support it somewhat, but you should still limit its use and only do so for certain field instead of entire log line.
Imagine if your log line is such:
{"login": [ {"SourceIP": "123", ...} ] }
Because of the structure of embedded list, the possibility to have multiple entries within one single log line is implied:
Are there guidelines or mutual understanding in the logging world about not doing embedding lists when it comes to logging?
I’m a rookie regarding JSON. My only thoughts are trying to find the right balance of providing suitable JSON to Grafana and also making the same JSON data usable for other purposes.
Both of my examples can be parsed with JQ, so in theory both formats are usable outside of Grafana.
Assuming you are able to parse such log line, what do you do regarding timestamp and the metadata labels?
In this case, it would be simpler and cleaner to change the logline by shifting the login one level down (assuming you care about it) so that each log line is self contained. For example, consider your original logline: