Hi,
the problem is very easy.
I have 2 variables:
On the dashboard the user can use the time picker as he wish. Samples of flow are nonlinear measured. There is no linear discrete time.
Goal: to have a number of consumption [m^3] of the nitrogen in selected time range.
Example:
If the time range is exactly 1h, and the flow=6 only, it can be used the avg fcn and the consumption=6.
If the value of flow varies, and the time range also, I don’t think, the avg fcn can be used. I’m looking for something like integral. Can anybody help, please?
You can "integrate" it manually.
Something like this
<your_initial_search>
| reverse ```You can do without reversing but it's gonna get confusing since the results will be offset by one```
| streamstats current=f window=1 values(_time) as prevtime ```copy timestamp of previous event```
| search prevtime=* ```remove the first event because there's no previous timestamp for it```
| eval duration=_time-prevtime ```we now know how much time elapsed since last sample```
| eval totalflow=flow*duration ```so we can count the total transferred amount```
(adjust for units - duration will be in seconds)
Hi PickleRick, thank you very much. This is the proper way.
You can "integrate" it manually.
Something like this
<your_initial_search>
| reverse ```You can do without reversing but it's gonna get confusing since the results will be offset by one```
| streamstats current=f window=1 values(_time) as prevtime ```copy timestamp of previous event```
| search prevtime=* ```remove the first event because there's no previous timestamp for it```
| eval duration=_time-prevtime ```we now know how much time elapsed since last sample```
| eval totalflow=flow*duration ```so we can count the total transferred amount```
(adjust for units - duration will be in seconds)