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:
In the Grafana Cloud navigation menu, click Explore.
From the data source picker at the top-left, select your Loki data source.
For example, select Production Loki.
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.
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"}, replacingvarlogswith a label value present in your logs. - List logs by job label — enter
{job=~".+"}to return log lines from every stream that has ajoblabel.
Tip: Use the Label browser in the query editor to discover which labels and values exist in your Loki data.
- Filter by job label — enter
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.