Skip to content

Commit 7eb56fa

Browse files
authored
More fixes for indentation and layout
1 parent 94d31dd commit 7eb56fa

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

articles/stream-analytics/stream-analytics-real-time-fraud-detection.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ In this procedure, you first create an event hub namespace, and then you add an
6161

6262
4. In the **Create namespace** pane, enter a namespace name such as `<yourname>-eh-ns-demo`. You can use any name for the namespace, but the name must be valid for a URL and it must be unique across Azure.
6363

64-
5. Select a subscription and create or choose a resource group, then click **Create**.
64+
5. Select a subscription and create or choose a resource group, then click **Create**.<br/><br/>
6565

66-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-eventhub-namespace-new-portal.png" alt="Create event hub namespace in Azure portal" width="300px"/>
66+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-eventhub-namespace-new-portal.png" alt="Create event hub namespace in Azure portal" width="300px"/>
6767

6868
6. When the namespace has finished deploying, find the event hub namespace in your list of Azure resources.
6969

@@ -73,7 +73,7 @@ In this procedure, you first create an event hub namespace, and then you add an
7373

7474
8. Name the new event hub `asa-eh-frauddetection-demo`. You can use a different name. If you do, make a note of it, because you need the name later. You don't need to set any other options for the event hub right now.
7575

76-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-eventhub-new-portal.png" alt="Name event hub in Azure portal" width="400px"/>
76+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-eventhub-new-portal.png" alt="Name event hub in Azure portal" width="400px"/>
7777

7878
9. Click **Create**.
7979

@@ -90,15 +90,15 @@ Before a process can send data to an event hub, the event hub must have a policy
9090
9191
3. Add a policy named `asa-policy-manage-demo` and for **Claim**, select **Manage**.
9292

93-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-shared-access-policy-manage-new-portal.png" alt="Create shared access policy for Stream Analytics" width="300px"/>
93+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-shared-access-policy-manage-new-portal.png" alt="Create shared access policy for Stream Analytics" width="300px"/>
9494

9595
4. Click **Create**.
9696

9797
5. After the policy has been deployed, click it in the list of shared access policies.
9898

9999
6. Find the box labeled **CONNECTION STRING-PRIMARY KEY** and click the copy button next to the connection string.
100100

101-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-shared-access-policy-copy-connection-string-new-portal.png" alt="Stream Analytics shared access policy" width="300px"/>
101+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-shared-access-policy-copy-connection-string-new-portal.png" alt="Stream Analytics shared access policy" width="300px"/>
102102

103103
7. Paste the connection string into a text editor. You need this connection string for the next section, after you make some small edits to it.
104104

@@ -142,7 +142,7 @@ Before you start the TelcoGenerator app, you must configure it so that it will s
142142

143143
2. Enter the following command:
144144

145-
```cmd
145+
```console
146146
telcodatagen.exe 1000 0.2 2
147147
```
148148

@@ -178,7 +178,7 @@ Now that you have a stream of call events, you can set up a Stream Analytics job
178178

179179
It's a good idea to place the job and the event hub in the same region for best performance and so that you don't pay to transfer data between regions.
180180

181-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-sa-job-new-portal.png" alt="Create Stream Analytics job in portal" width="300px"/>
181+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-create-sa-job-new-portal.png" alt="Create Stream Analytics job in portal" width="300px"/>
182182

183183
3. Click **Create**.
184184

@@ -271,11 +271,11 @@ In many cases, your analysis doesn't need all the columns from the input stream.
271271

272272
1. Change the query in the code editor to the following:
273273

274-
```SQL
275-
SELECT CallRecTime, SwitchNum, CallingIMSI, CallingNum, CalledNum
276-
FROM
277-
CallStream
278-
```
274+
```SQL
275+
SELECT CallRecTime, SwitchNum, CallingIMSI, CallingNum, CalledNum
276+
FROM
277+
CallStream
278+
```
279279

280280
2. Click **Test** again.
281281

@@ -289,13 +289,13 @@ For this transformation, you want a sequence of temporal windows that don't over
289289
290290
1. Change the query in the code editor to the following:
291291
292-
```SQL
293-
SELECT
294-
System.Timestamp as WindowEnd, SwitchNum, COUNT(*) as CallCount
295-
FROM
296-
CallStream TIMESTAMP BY CallRecTime
297-
GROUP BY TUMBLINGWINDOW(s, 5), SwitchNum
298-
```
292+
```SQL
293+
SELECT
294+
System.Timestamp as WindowEnd, SwitchNum, COUNT(*) as CallCount
295+
FROM
296+
CallStream TIMESTAMP BY CallRecTime
297+
GROUP BY TUMBLINGWINDOW(s, 5), SwitchNum
298+
```
299299
300300
This query uses the `Timestamp By` keyword in the `FROM` clause to specify which timestamp field in the input stream to use to define the Tumbling window. In this case, the window divides the data into segments by the `CallRecTime` field in each record. (If no field is specified, the windowing operation uses the time that each event arrives at the event hub. See "Arrival Time Vs Application Time" in [Stream Analytics Query Language Reference](https://docs.microsoft.com/stream-analytics-query/stream-analytics-query-language-reference).
301301
@@ -317,19 +317,19 @@ When you use a join with streaming data, the join must provide some limits on ho
317317
318318
1. Change the query in the code editor to the following:
319319
320-
```SQL
321-
SELECT System.Timestamp as Time,
322-
CS1.CallingIMSI,
323-
CS1.CallingNum as CallingNum1,
324-
CS2.CallingNum as CallingNum2,
325-
CS1.SwitchNum as Switch1,
326-
CS2.SwitchNum as Switch2
327-
FROM CallStream CS1 TIMESTAMP BY CallRecTime
328-
JOIN CallStream CS2 TIMESTAMP BY CallRecTime
329-
ON CS1.CallingIMSI = CS2.CallingIMSI
330-
AND DATEDIFF(ss, CS1, CS2) BETWEEN 1 AND 5
331-
WHERE CS1.SwitchNum != CS2.SwitchNum
332-
```
320+
```SQL
321+
SELECT System.Timestamp as Time,
322+
CS1.CallingIMSI,
323+
CS1.CallingNum as CallingNum1,
324+
CS2.CallingNum as CallingNum2,
325+
CS1.SwitchNum as Switch1,
326+
CS2.SwitchNum as Switch2
327+
FROM CallStream CS1 TIMESTAMP BY CallRecTime
328+
JOIN CallStream CS2 TIMESTAMP BY CallRecTime
329+
ON CS1.CallingIMSI = CS2.CallingIMSI
330+
AND DATEDIFF(ss, CS1, CS2) BETWEEN 1 AND 5
331+
WHERE CS1.SwitchNum != CS2.SwitchNum
332+
```
333333
334334
This query is like any SQL join except for the `DATEDIFF` function in the join. This version of `DATEDIFF` is specific to Streaming Analytics, and it must appear in the `ON...BETWEEN` clause. The parameters are a time unit (seconds in this example) and the aliases of the two sources for the join. This is different from the standard SQL `DATEDIFF` function.
335335
@@ -341,7 +341,7 @@ When you use a join with streaming data, the join must provide some limits on ho
341341
342342
3. Click **Save** to save the self-join query as part of the Streaming Analytics job. (It doesn't save the sample data.)
343343

344-
<img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-query-editor-save-button-new-portal.png" alt="Save Stream Analytics query in portal" width="300px"/>
344+
<br/><br/><img src="./media/stream-analytics-real-time-fraud-detection/stream-analytics-query-editor-save-button-new-portal.png" alt="Save Stream Analytics query in portal" width="300px"/>
345345

346346
## Create an output sink to store transformed data
347347

0 commit comments

Comments
 (0)