Send data to OMS Log Analytics with Curl from a Linux server

Here is an example how to send data to OMS Log Analytics with Curl from a Linux server. I have created a bash script that creates everything that is needed for Curl to send data to OMS Log Analytics. Just add your Workspace ID and Workspace Key and try it out. Hope it is useful for you!

Save the following script, make the changes necessary and then run it.

The first time you run the script OMS Log Analytics will create Custom Fields for you based on your data input.

Send data to OMS Log Analytics with Curl from a Linux server1

After some time, you will see the first data from your script. As for now, the data record will not be complete from the beginning. But after some time, the data record  will be updated and all information will be shown. When you see the full data record, all the following record will have all information from the beginning without any delay.

Send data to OMS Log Analytics with Curl from a Linux server2

To get more information, please have a look at Microsoft documentation – https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api

No comments yet.

Leave a Reply