JSON-tuples displayed each time in different order

Hi there,

I am using telegraf to collect some JSON input and fwd. it to Loki and Display in Grafana.
My test-Input looks like this:
{“error”: 2,“msg”: “Some error”, “code”: 212, “processid”: 412}

I configured the tail input and what I see in my dashboard is every time in different order:

json_order

My config looks like this:
[[inputs.tail]]
files = ["/tmp/test.log"]
data_format = “json”
json_string_fields = [“msg”]

Thanks for any ideas how to fix (configure) this.
Btw. I tested also with output to file, it is the same problem.

You can add sort option to your output file config:

[[outputs.file]]
  influx_sort_fields = true

Thanks a lot, this seems to me at a first glance to be used with the influx-serializer, right? I am using data_format = “json”, this param will most likely have no influence. Testing is showing me the same behaviour