Query regarding fetchhing of data

I have an influxdb measurement in which data is inserted continuously. I want to retrieve data points after a certain number of insertions have been done. For example Suppose there are 15 records already present in a measurement, after another 10 records have been inserted I want to retrive these 10 records for my python script. I want to do this without directly querong the database through a program but through alerts given by the kapacitor.

Is it possible to do so? And if possible how can I do this

If you don’t want to directly query the database to achieve the data retrieval, you could instead use a Kapacitor TICKscript for a stream task, which creates a subscription to InfluxDB so that all writes going to InfluxDB also get passed to Kapacitor. With the data in Kapacitor, you can then set various alerts to trigger at a given threshold or time. For more information on stream processing, check out the docs and this handy blog.

Will this use kapacitor UDFs. And if so can you point me out to few links where I can understand this in a much better way

I think you would potentially need a Kapacitor UDF here because you’re wanting to retrieve specific data for a Python script, which would be external to the Influx platform. This training/webinar gives a great intro on UDFs in Kapacitor, and how to integrate them.