Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Querying for something with substring matching


#1

Right now, when I try to query for something, it uses exact matching, like: SELECT max(diskUsedPercent) FROM StorageSample WHERE AppName= ‘appsample’

however is it possible for query to implement substring matching like: SELECT max(diskUsedPercent) FROM StorageSample LIKE AppName= ‘appsample’

so if I have appsample1, then it will get selected for, or if I change its name to appsample2, it will also get selected for as well.
I’m a bit new to New Relic, but I did not find any solutions in the NRQL documentation, and the discussion forum didn’t have a clear solution.


#2

@Stanley.Wong - yup, you can use a query like:

SELECT max(diskUsedPercent) FROM StorageSample WHERE AppName LIKE  ‘appsample%’

In this case, % is the wildcard character, so the query will return details for any app with a name beginning appsample

See more here:

https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-reference/nrql-syntax-components-functions#sel-where