Log Analytics Data Collector API

Grab data/information from anywhere and store this in Log Analytics. Basically any log, any OS, any type of data can be captured on a loop and sent to a Log Analytics workspace on a constant basis, then can be used to pull out reports etc.

My example below pulls the ‘Current Playing Song‘ out of radio station websites, it runs through many radio stations, at the end converts the aggravated results to JSON, then the data is sent to the Custom Log in Log Analytics using the API.

You can run the script below on a regular basis, e.g. set this up as a scheduled task.

To set things up and to get underway, there’s a few variables to set at the top of the script.

Both the $CustomerID and $SharedKey can be found from the Advanced Settings area of your Log Analytics workspace in the Azure Portal as shown below….



The $LogType is the name of your custom log file, you don’t need to create this prior to tunning the script, the Custom Log will be created the very first time you run the script under the name you give it here.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s