Log Analytics Data Collector API PowerShell Function

%3CLINGO-SUB%20id%3D%22lingo-sub-217449%22%20slang%3D%22en-US%22%3ELog%20Analytics%20Data%20Collector%20API%20PowerShell%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-217449%22%20slang%3D%22en-US%22%3E%3CP%3EI%20created%20a%20function%20that%20takes%20the%20input%20of%20time%2C%20log%20type%20and%20a%20hashtable%20and%20writes%20it%20to%20Log%20Analytics.%20This%20was%20intended%20to%20be%20a%20%E2%80%9Cuniversal%E2%80%9D%20log%20writer%20for%20Log%20Analytics.%20I%20use%20it%20in%20an%20Azure%20Automation%20Module%20so%20I%20can%20pass%20log%20data%20from%20any%20runbook%20to%20Log%20Analytics%20but%20it%20could%20be%20used%20in%20any%20PowerShell%20Script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFunction%20is%20on%20GitHub.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftsrob50%2FLogAnalyticsAPIFunction%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ftsrob50%2FLogAnalyticsAPIFunction%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELinks%20to%20Resources%20and%20overview%20video%20here%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fwww.ciraltos.com%2Fazure-oms-log-analytics-step-by-step-data-collector-api%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.ciraltos.com%2Fazure-oms-log-analytics-step-by-step-data-collector-api%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-217449%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowershell%20and%20Rest%20API%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Contributor

I created a function that takes the input of time, log type and a hashtable and writes it to Log Analytics. This was intended to be a “universal” log writer for Log Analytics. I use it in an Azure Automation Module so I can pass log data from any runbook to Log Analytics but it could be used in any PowerShell Script.

 

Function is on GitHub.

https://github.com/tsrob50/LogAnalyticsAPIFunction

 

Links to Resources and overview video here:

http://www.ciraltos.com/azure-oms-log-analytics-step-by-step-data-collector-api/