How-To: Analyze data from an Event Hub with Stream Analytics

In this How-To I will explain how you can use Stream Analytics to analyze data from an Event Hub. We will use the information we used in my other BlogPost.

First we will create our “Stream Analytics Job”.

You need to click on “New”, then we choose for “Data + Analytics” after that we select “Stream Analytics Job”

Then we fill in all the necessary information and click on the Create button.

Then we open our Analyzer. Now we will define our Inputs & Outputs.

First our input.
As you can see in the screenshot below we use the ordershub (eventhub) that we used in the previous blog post.

Then we create our Output.
In this example we will write to some blob storage

After that you should see the following in your “Stream Analytics Job”

Now we will write some query to analyze the data on the event hub and write it then to our Blob Storage.
As you can see below it’s an easy query, just to get all the Orders with a quantity higher then 20

  SELECT * FROM [OrderHub]
  WHERE Quantity > 20

When we now start our Analyzer, it will start processing our messages that we sent to the event hub.

Now we see in our output container the output from the Analyzer

This blog post explained how you can add easily some Stream Analytics. This was a very simple example.
But you can do great (aka complex) stuff with it.

If you have any questions. Feel free to comment on this post or contact me via Twitter,…