18 identical records in input stream; what's with that?

We’re looking into a problem where we get too many alerts from our TICKscript(s), and have come across some puzzling data. In one “window” of data, we see the same data record 18 times. How can that be?

Here’s the part of our script where we grab (and log) our data:

. . .
    var data = stream
            |from()
         		.database(database)
         		.retentionPolicy(retentionPolicy)
         		.measurement('api_detail')
            |where(lambda: "api" == targetApi)
            |window()
         		.period(period)
         		.every(every)
            |log().prefix('initial stream: ').level('DEBUG')
. . .

From that, we grep our log file to find the ‘initial stream’ line(s), which start with an entry like this:

[api-Plan.getTemplateNodeWithOrigin:log4] 2018/04/25 14:33:59 I! initial stream: {"name":"api_detail . . .

Then we grab that json that follows it and find that one of the items is in there 18 times. (Not sure what I can post publicly.)

That’s just one example. We have found many. It’s not always 18 duplicates; that number varies.

How is that possible?