Path

Run a LogQL query in Explore to verify logs flow through the new Loki data source.

Estimated time: 2 min

Verify logs in Explore

Passing the Save & test check confirms connectivity, but it doesn’t confirm that logs are flowing. In this milestone, you run a LogQL query against your new data source in Explore and see real log lines.

To verify logs in Explore, complete the following steps:

  1. In the Grafana Cloud navigation menu, click Explore.

  2. From the data source picker at the top-left, select your Loki data source.

    For example, select Production Loki.

  3. The Loki query editor has two modes. Use the Builder and Code tabs to switch between them. Select the Code tab to write a LogQL query by hand.

  4. In the query field, enter a LogQL query using a label selector.

    Try one of the following examples:

    • Filter by job label — enter {job="varlogs"}, replacing varlogs with a label value present in your logs.
    • List logs by job label — enter {job=~".+"} to return log lines from every stream that has a job label.

    Tip: Use the Label browser in the query editor to discover which labels and values exist in your Loki data.

  5. Click Run query to execute the LogQL query.

    You should see a Logs panel with a volume graph and matching log lines in the results pane. Expand any log line to inspect its labels, detected fields, and structured metadata.

Verify successful log access

After running your query, you should see:

  • A logs volume graph and a table of log lines in the Explore results panel
  • No authentication or connection errors
  • Log lines you can expand to view labels and detected fields
  • Timestamps and label values that match what you expect from your log sources

Congratulations! You’ve successfully connected a Loki data source to Grafana Cloud and verified log data.


More to explore (optional)