Microsoft recently released the Log Analytics HTTP Data Collector API which provides a way to send data into Microsoft OMS without requiring an OMS agent. To test this out I decided to start with Stefan’s blog series on how to inject data for stock prices. His blog posts are available at:
- Using the HTTP OMS Data Collector API for real-world scenario’s–Part 1: https://blogs.technet.microsoft.com/stefan_stranger/2016/09/05/using-the-http-oms-data-collector-api-for-real-world-scenarios-part-1/
- Using the HTTP OMS Data Collector API for real-world scenario’s–Part 2: https://blogs.technet.microsoft.com/stefan_stranger/2016/09/07/using-the-http-oms-data-collector-api-for-real-world-scenarios-part-2/
- Using the HTTP OMS Data Collector API for real-world scenario’s–Part 3: https://blogs.technet.microsoft.com/stefan_stranger/2016/09/23/using-the-http-oms-data-collector-api-for-real-world-scenarios-part-3/
- And this will hopefully be followed up by a part 4 where he will showcase the solution built with the view designer (which is really useful now especially since you can now import and export pre-built solutions!)
During my testing for part 2 of Stefan’s posts I ran into an issue. The data said that it was being sent to OMS (it reported a 202 which according to the documentation available at https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/ was a success. Unfortunately the only fields which appeared in OMS were the “TimeGenerated” and “SourceSystem” fields as shown below.
The next step I took was to “simplify the equation”. To do this I went direct to Brian Wren’s article for a simpler method to write direct to OMS through the API in PowerShell (https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/). Using his PowerShell script I also received a 202 and I confirmed that this was occurring with both attempts to write data to OMS through the API in PowerShell.
To be extremely comprehensive, I also tried Brian’s script writing to a different workspace in case it was a workspace specific issue – no change. This morning I re-tested both workspaces and they were experiencing the same issue.
What fixed it?
On the recommendation of Daniele, I closed all of my browsers and re-opened them to re-test and it now worked like a champ. The results are shown below for both types of data so I am ready to move on to more testing with the API!
Here is a successful set of data from Brian’s PowerShell script.
And here is a successful set of data from Stefan’s PowerShell script.
Summary: If you are not seeing data when you are successfully using the Log Analytics HTTP Data Collector API and it is indicating that it successfully wrote the data to OMS, close your browsers, re-open and re-test.
I hope that this blog post will save someone hours of debugging which I spent yesterday (and hopefully this is only a temporary issue).
Thank you to Stefan Stranger for the excellent blog post series, Brian Wren for a great starter post, and Stefan Roth for confirming that my results did not indicate that I had lost my sanity. Finally, thank you to Stan and Daniele for the browser restart recommendation.