The following Stream Analytics Query counts the number of events, grouped by IP Address, in 10-second Sliding Window intervals:
Select
Min(Time) as FirstHit,
Max(Time) as LastHit,
Count(*) as Total,
IPAddress
From
Input Partition By PartitionId TimeStamp By Time
Group By
SlidingWindow(second, 10), IPAddress, PartitionId
Having
Total >= 10
The resulting aggregation is output to an Event Hub.
The following JSON payload of 10 simple objects, spaced precisely 1-second apart, within a 10-second window is published to Stream Analytics, to be processed by the above Query:
[{
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:01"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:02"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:03"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:04"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:05"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:06"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:07"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:08"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:09"
}, {
"IPAddress": "192.168.0.10",
"Time": "2016-09-02T11:40:10"
}]
Both Stream Analytics job and Event Hub instance are newly-instantiated.
Stream Analytics does not output a corresponding event, despite the fact that the event-payload conforms to the Query criteria.
However, upon issuing a second request, publishing the same payload to Stream Analytics, an output event is created, with the correct metadata.
Is there a discrepancy in my configuration, or some sort of boot-strapper/warm-up/offset feature of Stream Analytics that results in the first payload being effectively ignored?