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

Ability to use string functions applied to facet'd column?

feature-request
insights
functions
string

#1

The FACET ${COLUMN_X} option for an NRQL Insight query is a great way to get a visual breakdown of how something is being used in your application… but sometimes the column being returned contains values that are quite hard to digest. (especially for the non-technical folks)

It would be awesome if there was a way to apply a string function to the column to return a more readable value. Any sort of Regex/SubString/Token matching would be helpful.

e.g. If I look to see all the “Microsoft Edge” browser usage… I can get a pretty chart, but what I care about most is the version of Edge (or the EdgeHTML version). Sadly in this case adding this query to a dashboard is useless because I can’t see the end of the user agent string where the specific Edge version is described.

Is there any chance we can get some string function abilities here? or is there a way that I can define multiple sub-queries where each renders as a “facet” in the output?


#2

Hey @scunliffe - Thanks for posting here. This is actually an existing feature idea here in the community, I’d recommend you vote in that thread.

There’s also a potential workaround to run a query that facets cases. Allowing you to separate the facets by cases that you specify in a where clause. You can see that full thread here:


#3

Hi, @scunliffe: If you are using New Relic Browser, you might try querying PageView rather than Transaction:

SELECT count(*) 
FROM PageView 
WHERE userAgentName = 'Microsoft Edge' 
FACET userAgentVersion 
SINCE 30 days ago


#4

Thanks for the idea Phil. Unfortunately we don’t have Browser enabled yet.


#5

Hi @scunliffe,

Have you tried Ryan’s suggestion of faceting using the CASES clause? Labeling the groups with the AS clause would allow you to break everything out by browser name and version. The query itself could take a bit to set up as you’ll need to identify both the browser and the version, then set up the filter for specifics from the user agent string. But, it should get you what you need for now.