influxdata / influxdata/kapacitor
Is it possible alter 'time' field when kapacitor save result into output measure?
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
My task is to accumulate values from some measure every seconds and reset that accumulated values to zero after hour.
I wrote some code for kapacitor
var input = batch
|query('SELECT SUM("val") as "val_sum" FROM "srtdb"."autogen".factory011 ORDER BY desc limit 1')
.period(1h)
.every(1s)
.groupBy('position', time(1h))
input
|influxDBOut()
.database('srtdb')
.retentionPolicy('autogen')
.measurement('kuku14')
but there are only records related to hours, second’s records don’t exist.
Is it possible to create a second’s records or alter 'time' field when kapacitor save result?
Contributor guide
Research direction
Start with the batch task shown in the issue, tracing the query(), period(), every(), groupBy(), and influxDBOut() settings. Check the Kapacitor behavior for timestamp assignment and write frequency, then determine whether per-second output or time alteration is supported; done means a documented answer or a clearly scoped change request.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100