• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

Parsing log data

Log parsing transforms unstructured log data into searchable attributes that you can use to gain deeper insights from your logs. These attributes allow you to filter, facet, and alert on your data with precision.

Choose your parsing strategy

Decide whether to parse data at ingest-time or when you run a query:

Parsing type

Description

Best for

Query-time parsing

Creates temporary attributes using NRQL that exist only during query execution. Ideal for instant analysis of existing data without waiting for new logs to flow in. Learn more about query-time parsing.

  • Ad hoc troubleshooting and investigations
  • Exploratory analysis on small datasets
  • One-time investigations
  • Extracting attributes from logs already stored in NRDB

Ingest-time parsing

Creates permanent attributes stored in NRDB. Two ways to create ingest-time parsing rules:

  • Built-in parsing rules: Pre-configured patterns for common log sources (Apache, NGINX, CloudFront, MongoDB, etc.). Simply add a logtype attribute when forwarding logs. See the full list of built-in rules.

  • Custom parsing rules: When your logs are unique to your application, custom parsing rules let you define exactly which fields matter to your business.

    • No Code Log Parsing: Detects patterns in your sample logs. Best for users who want to point-and-click to extract fields.
    • Custom Grok/Regex: Manual code entry for highly complex log formats.
  • High volumes of logs
  • Parsed attributes needed for alerts, dashboards, and continuous monitoring

You can also create, query, and manage your log parsing rules by using NerdGraph, our GraphQL API. A helpful tool for this is our Nerdgraph API explorer. For more information, see our NerdGraph tutorial for parsing.

How custom ingest-time parsing works

Custom parsing allows you to define exactly how New Relic structures your incoming logs. Before creating rules, it is important to understand the technical constraints of the ingestion pipeline.

Log parsing

How it works

What

Parsing rules are highly targeted. When you create a rule, you define:

  • The targeted field: Parsing is applied to one specific field at a time.
  • The matching logic: Use a NRQL WHERE clause to filter exactly which logs this rule should evaluate.
  • The extraction method: You can use No Code Log Parsing for automatic and guided pattern detection experience or manually write Grok/Regex for highly customized and complex log structures.

When

New Relic processes logs in a sequential order. This affects which conditions can be matched.

  • Parsing happens while data is ingested. Once a log is written to the NRDB, changes made are permanent.
  • Once a rule is saved and enabled, rules begin processing incoming logs immediately.
  • Parsing occurs before data enrichment (such as entity synthesis), dropped, or partitioned.

Validation

To ensure your rules work before they affect ingested data, you can preview the output against 10 log samples recently stored in the ‘Log’ partition. These samples represent data received within the last 30 minutes, rather than a real-time live stream.

Create a custom rule

You can create parsing rules in-context while investigating a log. This avoids context switching and shortens Mean Time to Detect (MTTD). Alternatively, you can create rules from scratch when onboarding a new application or service.

No Code Log Parsing

Use No Code Log Parsing to detect and extract fields from your sample logs. New Relic analyzes your sample logs and suggests patterns you can configure.

To create a rule in-context, go to one.newrelic.com > Logs and apply a filter (or select any entity that has logs, such as APM, Browser, or Mobile, and navigate to Logs in Context).

To create a rule without context, go to one.newrelic.com > Logs without setting a filter, or go to Logs > Parsing and click Create a parsing rule.

In the in-context rule creation process:

  1. Click a log to open Log details
  2. Select the log attribute you want to parse (for example, message)
  3. Click Create ingest time parsing rule and provide a name for your rule

If you've applied a filter in the Logs UI before creating the rule, a matching condition is automatically populated based on that filter.

Screenshot of log filtering in UI

In the without context flow, provide a name for your rule and set a NRQL filter condition or paste a sample log.

  • If you set a log filter, click Run your query, select the field you want to parse, and click Next.
  • If you paste a sample log, you must define the NRQL WHERE clause to match your logs, select the field you want to parse, and click Next.
Screenshot of creating a parsing rule in UI

Review the Patterns we detected in the selected sample log and the rule that was authored. Click a highlighted pattern to view and edit its configuration.

Screenshot of matching pattern in UI

Note

  • When naming attributes, use lowercase with underscores. Avoid special characters except underscores, and don't start an attribute name with a number.

  • For substrings you wish to avoid parsing that include values which are dynamic, make sure to set them as dynamic substrings by selecting and changing their configuration to Yes.

For more granular control over the fields to extract, click and drag to highlight the sample log.

Screenshot of creating a parsing rule in UI

You can interact with the patterns in the following ways:

  • Auto detect patterns: To detect patterns in any part of the sample log that's not already highlighted, click and drag to highlight that substring and click Auto detect patterns. New Relic will find and highlight patterns in your selected portion. For a list of supported Grok pattern names, see Supported Grok pattern names.
  • Select text to parse: Select this mode for the guided rule authoring experience. This mode offers a pattern-by-pattern configuration. Once pattern configurations are set, click Add pattern to rule to see the updated rule and preview output.

If detected patterns are not relevant or extracting unwanted data, you can remove them from the authored rule by:

  • Highlight the unwanted pattern in the sample log window and click Remove selected patterns, or
  • Click a pattern and select Remove.

Review the Preview output panel. Check that sample logs show a green checkmark, indicating they match your rule and fields will be extracted at ingest time.

  • To change your sample, expand any log in the Preview output panel and click Use as sample.
    • If you selected an unmatched log: The selected sample will show up in the sample log window, new patterns will be detected, and a new rule will be authored.
    • If you selected a matched log: The selected sample will show up in the sample log window.

Click Save rule to activate immediately, or Save as draft to activate later.

Write your own custom Grok/Regex

For unique formats, advanced users can click on Write your own rule on the Create a parsing rule page to switch to the code editor and modify patterns directly in the rule editor.

Screenshot depicting where to click to write your own custom Grok/Regex

Once done editing the rule, click Preview to see the updated preview output and click Save rule to activate it.

Note

To switch to the legacy editor, click Switch to original editor in the top right corner of the Create a parsing rule page.

Supported data patterns

New Relic supports parsing various data types and data formats using Grok patterns. Parsing patterns are specified using Grok, an industry standard for parsing log messages. Grok is a superset of regular expressions that adds built-in named patterns to be used in place of literal complex regular expressions.

Parsing rules can include a mix of regular expressions and Grok pattern names in your matching string. Click this link for a list of supported Grok patterns, and here for a list of supported Grok types.

Manage parsing rules

After creating parsing rules, you can manage them from Logs > Parsing. Draft rules are saved but not yet activated. You can activate them when you're ready to apply them to incoming logs.

To edit a parsing rule:

  1. In your parsing rules list, click the rule name or click ... > Edit and make the required changes. To switch to the code editor, click Write your own rule to write or modify Grok/Regex patterns directly.
  2. Click Save rule (or Save as draft if you want to keep it disabled).

Changes apply to logs ingested after the update. To enable, disable, or delete a parsing rule:

  1. Find the rule in your parsing rules list and click ... menu.
  2. Choose an action:
    • Enable: Activates the draft rule (applies to newly ingested logs immediately)
    • Disable: Temporarily pauses the active rule
    • Delete: Removes the rule completely

Limits

Parsing is computationally intensive. To ensure platform stability, New Relic enforces the following:

  • Per-message limit: A rule has 100ms to parse a single message. If it exceeds this, parsing stops for that message.
  • Per-account limit: Total processing time is capped per minute. If you hit this, logs remain unparsed (stored in their original format).
  • Pipeline timing: Parsing occurs before enrichment. You cannot match a parsing rule against an attribute that hasn't been added yet (like a tag added later in the pipeline).
  • The first-match rule: Parsing rules are unordered. If multiple rules match a single log, New Relic applies one at random. Ensure your NRQL WHERE clauses are specific enough to avoid overlapping matches.

To easily check if your rate limits have been reached, go to your system Limits page in the New Relic UI.

Troubleshooting

If parsing isn't working the way you intended, it may be due to:

  • Logic: The parsing rule matching logic doesn't match the logs you want.
  • Timing: If your parsing matching rule targets a value that doesn't exist yet, it will fail. This can occur if the value is added later in the pipeline as part of the enrichment process.
  • Limits: There is a fixed amount of time available every minute to process logs via parsing, patterns, drop filters, etc. If the maximum amount of time has been spent, parsing will be skipped for additional log event records.

To resolve these problems, create or adjust your custom parsing rules.

Built-in log parsing rules

Explore pre-built patterns from New Relic.

Query log data

Use parsed attributes in NRQL queries.

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.