• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Support for NRQL functions in pipeline rules

This document outlines the NRQL functions supported by the Pipeline Control gateway. This enhancement provides ways to manage your data within New Relic.

Function

Description

Example NRQL query

[aparse()](/docs/nrql/nrql-syntax-clauses-functions/#func-aparse)

Extracts a value from a string based on a specified pattern.

DELETE FROM Log WHERE aparse(message, 'Error: %') = 'timeout'

[dimensions()](/docs/nrql/nrql-syntax-clauses-functions/#func-dimensions)

Filters data based on facets or dimensions associated with your metrics/events.

DELETE FROM Log WHERE dimensions() LIKE '%collectd%'

[floor()](/docs/nrql/nrql-syntax-clauses-functions/#floor)

Returns the largest integer less than or equal to the specified number.

DELETE FROM Metric WHERE floor(duration) > 5

[getField()](/docs/nrql/nrql-syntax-clauses-functions/#func-getfield)

Extracts a specific field from a complex data structure (for example, JSON object).

DELETE FROM Metric WHERE getField(cpu_usage, percent) > 90

[hourOf()](/docs/nrql/nrql-syntax-clauses-functions/#func-minOf)

Extracts the hour component from a timestamp.

DELETE FROM Log WHERE hourOf(timestamp) IN (2, 3, 4)

[mod()](/docs/nrql/nrql-syntax-clauses-functions/#func-mod)

Returns the remainder of a division operation.

DELETE FROM Log WHERE mod(timestamp/1000,20) != 1

[numeric()](/docs/nrql/nrql-syntax-clauses-functions/#type-conversion)

Converts a string value to a numerical type.

DELETE FROM Log WHERE numeric(responseTime) > 1000

[round()](/docs/nrql/nrql-syntax-clauses-functions/#round)

Rounds a number to the nearest integer or to a specified number of decimals.

DELETE FROM Metric WHERE round(latency, 2) > 0.5

[string()](/docs/nrql/nrql-syntax-clauses-functions/#func-string)

Converts a numerical or other value to a string type.

DELETE FROM Log WHERE string(statusCode) = '404'

[substring()](/docs/nrql/nrql-syntax-clauses-functions/#func-substring)

Extracts a specified portion of a string.

DELETE FROM Log WHERE substring(transactionId, 1, 3) = 'tmp'

weekdayOf()

Extracts the day of the week from a timestamp (for example, 'Monday', 'Sunday').

DELETE FROM Metric WHERE weekdayOf(timestamp) IN ('Saturday', 'Sunday')

Examples of NRQL functions in pipeline rules

These examples demonstrate how you can combine multiple functions and use them in more intricate scenarios to achieve precise data filtering and deletion.

  • DELETE FROM ContainerSample WHERE state = 'exited' and status LIKE '%Exited%' and status NOT LIKE '%second%' and status not like '%About a minute ago%' and not (status like '%minute%' and numeric(aparse(status,'%Exited (%) * minutes ago%')) < 10)
  • DELETE FROM Log, LogExtendedRecord WHERE dimensions() LIKE '%collectd%' AND newrelic.logs.customEventType IS NULL
  • DELETE FROM Log WHERE message LIKE '%lib/ladon/middleware/caching.rb:49 run> terminated with exception%' and floor(timestamp/101) = (timestamp/101)

These new functions significantly expand the capabilities of your NRQL queries when working with Pipeline Control gateway, allowing for more precise data analysis and management.

Copyright © 2025 New Relic Inc.

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