Forum Discussion
OMS Query for exporting results in excel more than 10000 results
- Dec 27, 2018
Hi,
Indeed there is a 10K cap on the result set size in the UI, but there are a number of ways to handle larger result sets.
1. You can transform your results into an array, which can hold much more than 10K values. See this example, where over 40K values are put into a single array, that you can later export to excel. That would of mean you need to use excel formulas if you want to return to a tabular structure.
2. Reduce the size of your results - you can use "distinct Computer", "summarize by Computer" or "summarize makeset" to remove duplicate values from your results (Also, if all you need is that computer's name, project only that column).
3. Use the API - the 10K results limit is only a UI limitation, so if you use the API you'll always get the full result set. In your script, you can process the result set to create a CSV structure which excel can load.
HTH,
Noa
This script does exactly what you want - export the data into a CSV. And yes, you will be able to export more than just 10.000 records.
https://www.powershellgallery.com/packages/Invoke-AzOperationalInsightsQueryExport
I think the most you can export is 500.000 records actually.
As well as call rate limits and daily quota caps, there are also limits on queries themselves:
- Queries cannot return more than 500,000 rows
- Queries cannot return more than 64,000,000 bytes (~61 MiB total data)
- Queries cannot run longer than 10 minutes by default. See this for details.