Forum Discussion
sqldba100
Mar 11, 2019Copper Contributor
RunBook and Log Analytics
I Have a query to run against Log Analytics . This query I need to run Via RunBook. SO please suggest how to run a query in Log Analytics using RunBook.
Next question is the results fetched from above query need to be exported into Blob. How can we export requery from Log Analytics into Blob.
2 Replies
- abovethekloud is correct. Also there is official PowerShell module for Log Analytics with which you can execute queries:
- abovethekloudCopper Contributor
You should be able to run queries via PowerShell using the REST API. See https://dev.loganalytics.io/documentation/Tools/PowerShell-Cmdlets
or the following blog from tao yan
https://blog.tyang.org/2017/11/14/searching-oms-using-the-new-search-language-kusto-rest-api-in-powershell/
Regarding the export, wouldn't it be a option to create an alert that launches a runbook so you can use powershell / scripting again to write the data back to the blob?