Forum Discussion
Brady Evans
Jan 12, 2018Copper Contributor
Invoke-LogAnalyticsQuery only returns Tables JSON Array and not Results Array
I'm trying to use the new PowerShell based API (Invoke-LogAnalyticsQuery - see below) and the return payload only includes the Tables array and not the Results array as documented..
import-...
- Jan 14, 2018
Hi Brady,
First, I must comment on your query. You should avoid queries that has 'search * | where Type =='. Instead the query below should just be: 'Heartbeat | take 10'. Search * is very inefficient way to use the system.
Regarding the results array. I ran the same code but didn't managed to reproduce. I got both tables and results.
Sorry
Meir
Brady Evans
Jan 16, 2018Copper Contributor
Meir, thanks for the pointer on query optimization. I did figure out that I am getting the results. It seems the shape of the JSON result you get back from Invoke-LogAnalyticsQuery doesn't match what is documented at:
https://dev.loganalytics.io/documentation/Tools/PowerShell-Cmdlets.
Thanks again.
Ketan Ghelani
Jan 18, 2018Iron Contributor
Adding Chris Suich