That was bonkers hard to figure out. I took out some of the joins to make this clearer.
* | rex field=source ".*/(?<my_int>\d+)_(?<my_max>\d+)_.*_(?<my_system>\w+).txt"
| eval intsys = my_int."_".my_system
The next 2 lines set up a running count over continuous days
| timechart limit=0 span=1d count by intsys
| untable _time intsys value
Now we figure out the cumulative totals by day
| streamstats sum(value) as total by intsys
Here's the tricky bit. For every given int_sys, find the range of time the series is valid
| eventstats max(eval(if(value > 0,_time,NULL))) as mxtime min(eval(if(value > 0,_time,NULL))) as mntime by intsys
Discard values outside of the valid range
| eval total=if(_time < mntime or _time > mxtime,NULL,total)
Then plot it
| xyseries _time,intsys,total
| makecontinuous _time
Before : ( reversed the direction, and reset the count for each integer/system )
After:
... View more