So after messing around a bit, I have found a clunky way to achieve what I wanted, may it helps other!
First I have created a macro, that takes the last search of the jobs list with the given search name, and return its earliest time (MY_MACRO):
MY_MACRO(search_name, "hours to subtract before earliest schedule time")
[| rest /services/search/jobs
| search label="$arg1$"
| head 1
| eval earliest=substr(earliestTime, 1, 19)
| eval earliest=strptime(earliest,"%Y-%m-%dT%H:%M:%S")
| eval earliest=earliest-$arg2$*3600
| eval earliest=round(earliest, 0)
| return earliest]
Note that you shouldn't return $earliest as in a macro it will not work (maybe interpreted as an argument cause of the $ sign, see here.
Then, take the search you want to backfill summary index, let's take index=MY_INDEX as an example (name it MY_SEARCH), and add the MY_MACRO value at the end, so the final search is:
index=MY_INDEX MY_MACRO(MY_SEARCH, "hours to subtract before earliest schedule time")
You can then use fill_summary_index.py with this search, the earliest time will be the scheduled time (the UTC+ ... time you can see in the console log), and not the time you run the search.
Thanks very much to Ayn, Martin and alacercogitatus for the help, I think I'm done with it.
... View more