SOLVED

Saved Searches API

%3CLINGO-SUB%20id%3D%22lingo-sub-159405%22%20slang%3D%22en-US%22%3ESaved%20Searches%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-159405%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%26nbsp%3Busing%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Floganalytics%2Fsavedsearches%2Fgetresults%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Floganalytics%2Fsavedsearches%2Fgetresults%3C%2FA%3E%26nbsp%3Bi%20receive%20the%20following%20error%3A%3C%2FP%3E%0A%3CP%3E%E2%80%9C%7B%22error%22%3A%7B%22code%22%3A%22InvalidOperationArgument%22%2C%22message%22%3A%22Saved%20search%20result%20not%20supported%20for%20the%20new%20query%20language%22%7D%7D%E2%80%9D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI've%20tried%20using%26nbsp%3B%26nbsp%3BAPI%20versions%20%E2%80%9Capi-version%3D20150320%E2%80%9D%20and%20%E2%80%9C20170101preview%22%20(dashes%20removed)%20and%20receive%20the%20above%20error.%26nbsp%3B%20Is%20Save%20Search%20supported%20in%20the%20new%20query%20language%3B%20if%20not%2C%20when%20will%20the%20API%26nbsp%3Bbe%20updated%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-159405%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowershell%20and%20Rest%20API%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-159497%22%20slang%3D%22en-US%22%3ERe%3A%20Saved%20Searches%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-159497%22%20slang%3D%22en-US%22%3EThanks%20-%20this%20works!%20Couple%20of%20extra%20steps%20but%20the%20desired%20result%20is%20achieved.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-159454%22%20slang%3D%22en-US%22%3ERe%3A%20Saved%20Searches%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-159454%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EI%20do%20not%20have%20information%20if%20such%20api%20will%20be%20created%20for%20the%20new%20language%20but%20you%20can%20get%20the%20query%20programmatically%20via%20the%20api%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Floganalytics%2Fsavedsearches%2Fget%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Floganalytics%2Fsavedsearches%2Fget%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eand%20than%20execute%20it%20via%20the%20new%20api%20for%20executing%20queries%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdev.loganalytics.io%2Fdocumentation%2FUsing-the-API%2FRequestFormat%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.loganalytics.io%2Fdocumentation%2FUsing-the-API%2FRequestFormat%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20latest%20AzureRM%20modules%20also%20support%20executing%20query%20via%20the%20new%20api%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Freleases%2Ftag%2Fv5.3.0-February2018-rtm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Freleases%2Ftag%2Fv5.3.0-February2018-rtm%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20this%20helps%20a%20little%20bit!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

When using https://docs.microsoft.com/en-us/rest/api/loganalytics/savedsearches/getresults i receive the following error:

“{"error":{"code":"InvalidOperationArgument","message":"Saved search result not supported for the new query language"}}”

 

I've tried using  API versions “api-version=20150320” and “20170101preview" (dashes removed) and receive the above error.  Is Save Search supported in the new query language; if not, when will the API be updated?

2 Replies
Best Response confirmed by Daniel Thilagan (New Contributor)
Solution

Hi

I do not have information if such api will be created for the new language but you can get the query programmatically via the api:

https://docs.microsoft.com/en-us/rest/api/loganalytics/savedsearches/get

 

and than execute it via the new api for executing queries:

https://dev.loganalytics.io/documentation/Using-the-API/RequestFormat

 

The latest AzureRM modules also support executing query via the new api:

https://github.com/Azure/azure-powershell/releases/tag/v5.3.0-February2018-rtm

 

Hope this helps a little bit!

 

Thanks - this works! Couple of extra steps but the desired result is achieved.