Hello I would like to ask question related to below topic.
I want to retrieve events backtracking up to 96 h
for drive events .
However, I was only able to retrieve partial of them .
Looking at DEBUG log , the startTime was replaced by different value in the follow-on request .
- Initial polling (startTime=2022-03-26T14%3A33%3A42Z)
2022-03-30T14:33:42.912Z INFO [input.httpjson-cursor] compat/compat.go:111 Input httpjson-cursor starting {"id": "BBFA557C8D443451"}
2022-03-30T14:33:42.914Z DEBUG [input.httpjson-cursor] v2/cursor.go:27 new cursor: nothing loaded {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.914Z INFO [input.httpjson-cursor] v2/input.go:112 Process another repeated request. {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.914Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:84 template execution: falling back to default value {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.914Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:97 template execution: evaluated template "2022-03-26T14:33:42Z" {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.914Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:97 template execution: evaluated template "2022-03-26T14:33:42Z" {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.914Z DEBUG [input.httpjson-cursor] v2/request.go:77 new request: v2.transformable{"header":http.Header{"Accept":[]string{"application/json"}, "User-Agent":[]string{"Elastic-Filebeat/7.17.1 (linux; amd64; 1d05ba86138cfc9a5ae5c0acc64a57b8d81678ff; 2022-02-23 23:38:04 +0000 UTC)"}}, "url":(*url.URL)(0xc00080d3b0)} {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:42.916Z DEBUG [input.httpjson-cursor.retryablehttp] go-retryablehttp@v0.6.6/client.go:504 performing request%!(EXTRA string=method, string=POST, string=url, *url.URL=https://oauth2.googleapis.com/token) {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:43.088Z DEBUG [input.httpjson-cursor.retryablehttp] go-retryablehttp@v0.6.6/client.go:504 performing request%!(EXTRA string=method, string=GET, string=url, *url.URL=https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive?startTime=2022-03-26T14%3A33%3A42Z) {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}```
- Polling for page2 (startTime=2022-03-30T14%3A33%3A46Z)
2022-03-30T14:33:46.758Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:97 template execution: evaluated template "2022-03-30T14:33:46Z" {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:46.758Z DEBUG [input.httpjson-cursor] v2/cursor.go:56 cursor.last_execution_datetime stored with 2022-03-30T14:33:46Z {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:46.759Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:97 template execution: evaluated template "2022-03-30T14:33:46Z" {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:46.759Z DEBUG [input.httpjson-cursor] v2/value_tpl.go:97 template execution: evaluated template "A:1648627960313000:-5113882487620209611:777491262838:C04ha7adf" {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:46.759Z DEBUG [input.httpjson-cursor] v2/request.go:77 new request: v2.transformable{"header":http.Header{"Accept":[]string{"application/json"}, "User-Agent":[]string{"Elastic-Filebeat/7.17.1 (linux; amd64; 1d05ba86138cfc9a5ae5c0acc64a57b8d81678ff; 2022-02-23 23:38:04 +0000 UTC)"}}, "url":(*url.URL)(0xc004fd82d0)} {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
2022-03-30T14:33:46.759Z DEBUG [input.httpjson-cursor.retryablehttp] go-retryablehttp@v0.6.6/client.go:504 performing request%!(EXTRA string=method, string=GET, string=url, *url.URL=https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive?pageToken=A%3A1648627960313000%3A-5113882487620209611%3A777491262838%3AC04ha7adf&startTime=2022-03-30T14%3A33%3A46Z) {"id": "BBFA557C8D443451", "input_source": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive", "input_url": "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive"}
As described in the doc , I believe the parameters except the pageToken should be the same as initial request when paginating.
In your follow-on request getting the next page of the report, enter the
nextPageToken
value in thepageToken
query string.
Would there be anyway to set same values for the startTIme on all pagination requests ?
Filebeat I used is 7.16.1
and configuration used for my testing is on below gist.
Any advice is appreciated !
Thanks,
Yu watanabe