Making a simple time series chart from a JSON log file. Complete newbie

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    Trying to get a time series chart from JSON log information from a file using Loki data source

  • How are you trying to achieve it?
    I don’t know what I’m doing. Very new to grafana. I can find my host’s log file using label filters in the query. Beyond that I’m lost

  • What happened?
    Data is missing a number field

  • What did you expect to happen?
    The JSON data contains an id and date, plus some other numeric info I want to plot on the chart Y axis with time/date on the X axis. A new log with values gets pushed once per hour to grafana, and grafana is getting them (see explanation below).

  • Can you copy/paste the configuration(s) that you are having problems with?
    {hostname=“hostname”, filename=“data.log”} | json FIELD_I_WANT_TO_GRAB
    I don’t even know if I’m doing this right. That’s about as far as I got before brain fade.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Not really, no. I can switch the data format to table, but the fields here are “labels”, “Time”, “line”, “tsNs”, and “id”. All my JSON data is visible inside the Line field, verbatim to what’s in
    each log entry in log file. (e.g. {“id”:“12345”, “date”: “2022-10-20 01:00:00”, “TOTAL”: 1, “OTHER_TOTAL”: 5} etc.
    I just want the table to have all my JSON info

  • Did you follow any online instructions? If so, what is the URL?
    Nope. Just muddling my way through