Fetch records > 2000 datarows

Hi

While executing below NRQL for last 2 months i am unable to fetch more than 2000 records. Is there any way i can bypass this limit by changing the query.

Also any way i can export all data at once?

SELECT count( *),latest(timeSinceLoad) FROM PageAction SINCE 1 week ago FACET ohr,pageUrl,email,role,vertical,type,actionName,city, countryCode,dateOf(timestamp) as ‘Date’ LIMIT MAX WHERE appName=’’

Hi @mohd.salman - The 2000 records is a hard limit. To export your data you would need to automate by using the NerdGraph API to query for short time periods and process that data into your target data store.

2 Likes

How can i automate? I tried query using Nerdgraph but the output is in json form, do i need to convert this output every time to tabular form & does it give it >2000 records in one query?

You will need to write a script or code to pull the data you require. There is no automated solution supplied by New Relic to extract the data you require.

Yes, the output is in JSON and you will need to translate that into the correct format for your data store or reporting requirements.

The Nerdgraph API will not give you more than 2000 records in one query. You will have to make multiple queries to return over 2000 records which will depend on the frequency of event creation for your monitoring solution.

1 Like