Forum Discussion
Invoke-LogAnalyticsQuery only returns Tables JSON Array and not Results Array
- 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
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 EvansJan 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 GhelaniJan 18, 2018Iron Contributor
Adding Chris Suich