Filter logs by time range

Time range filtering is essential for log investigation. Whether you’re troubleshooting an incident that occurred at a specific time or analyzing patterns over a period, Grafana’s time picker lets you quickly narrow down your log search to the relevant window.

In this milestone, you’ll use the time picker to filter your Elasticsearch logs to a specific time range.

To filter logs by time range, complete the following steps:

  1. In the Explore interface, locate the time picker in the upper right corner (displays the current time range, for example “Last 1 hour”).

  2. Click the time picker to open the time range options.

  3. Select a preset time range or define a custom range:

    • Preset ranges: Click options like Last 15 minutes, Last 1 hour, or Last 24 hours.
    • Custom range: Click Absolute time range and enter specific start and end times.

    For example, select Last 15 minutes to see recent logs during an active incident.

  4. Click Apply time range (if using custom range) or the preset option to update the query.

  5. Observe that the log results update to show only entries within the selected time window.

  6. (Optional) Use the time range zoom controls in the log panel to narrow or expand the visible time window.

The log results display only entries within your selected time range, and the time picker shows your chosen window.

In the next milestone, you’ll add your log query to a dashboard for ongoing monitoring.

More to explore (optional)

At this point in your journey, you can explore the following paths:

Set dashboard time range


page 7 of 9