Find an issue's cause or impact with surrounding logs

Problem

You want to see what led up to an issue so you can identify its root cause. Or, you want to see what followed an event so you can assess its impact. But when you query for the log line or lines you're interested in, all non-matching lines are filtered out.

Solution

Often the lines that come before or after the log data that you queried can help you understand the context of the queried lines. By default, New Relic shows 30 minutes of logs surrounding your query (up to 15 minutes before and 15 minutes after the selected log).

  1. Go to one.newrelic.com > Logs.

  2. Enter a query to focus on the type of log info you need, then click Query logs.

  3. Click the log line you want to examine in more detail.

  4. From the attributes list, click the Show surrounding logs [Show surrounding logs icon] icon.

Your selected (highlighted) log line is fixed so that you can still see it while you scroll the surrounding logs. To change the selected log, do any of the following:

  • Click the Hide surrounding logs [Hide surrounding logs icon] icon.
  • Select another log line.
  • Run a different query.

For more help

If you need more help, check out these support and learning resources: