7.03L Explore Loki Log - MartinWong06/grafana GitHub Wiki

  1. Go to the Grafana homepage and select the Explore option from the left-hand menu.

  2. In the Explore interface, select the Loki data source from the drop-down menu in the top left corner.

  3. Select the log stream you want to explore from the "Log streams" drop-down menu. You can select one or more streams by clicking on them while holding down the CTRL or CMD key.

  4. Enter your query in the query editor. You can use the same syntax as you would in Prometheus PromQL, but with some additional Loki-specific functions.

  5. Optionally, you can filter the results using the labels associated with your logs. You can add filters in the "Filters" tab below the query editor.

  6. Click the "Run query" button to execute your query.

  7. The results of your query will be displayed in the table below the query editor. You can further refine your query using the column filters and sorting options available.

  8. You can also create a Time Series Panel or Logs Panel of your log data by selecting the "Time Series" or "Logs " tabs respectively. Here you can customize the display options for your chart, such as the time range and aggregation function.

  9. Finally, you can save your query and chart as a new panel in a dashboard by clicking the "Save" button in the top right corner of the Explore interface.