[8.19] [Reporting] Fix timestamp override for ES|QL CSV scheduled reports with relative time ranges (#248169)#249051
Merged
kibanamachine merged 2 commits intoelastic:8.19from Jan 15, 2026
Conversation
…th relative time ranges (elastic#248169) Resolves elastic#245281 ## Summary This PR updates the code to generate ES|QL csv reports to use forceNow for relative time ranges. To do this we added a new locator function to get the `timeFieldName` from the job params bc the ES|QL time range filters don't have the meta field populated. ### Checklist Check the PR satisfies following conditions. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### To verify 1. Create a data view on .kibana-event-log* 2. Use the query below in dev tools to create a scheduled report with a hardcoded relative time range (You can adjust the timerange in the job params to what you want when you're testing) 3. Verify that the eventual CSV report has data in the correct time range <details> <summary> <b>Query</b> </summary> This scheduled report will run every minute 🙂 ``` POST kbn:/internal/reporting/schedule/csv_v2 { "schedule": { "rrule": { "freq": 3, "interval": 1, "byhour": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ], "byminute": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ] } }, "jobParams": "(browserTimezone:America/Los_Angeles,isEsqlMode:!t,locatorParams:!((id:DISCOVER_APP_LOCATOR,params:(columns:!(),dataViewSpec:(allowHidden:!f,allowNoIndex:!f,fieldFormats:(),id:'1a05eb41b8d4c4075bf8e71e472bc9855314219a15ddb77af59342159e67beb2',managed:!f,name:'.kibana-event-log*',runtimeFieldMap:(),sourceFilters:!(),timeFieldName:'@timestamp',title:'.kibana-event-log*',type:esql),filters:!(),hideChart:!t,interval:auto,query:(esql:'FROM .kibana-event-log*'),refreshInterval:(pause:!t,value:60000),sort:!(),tab:(id:'203820a6-4f09-4b15-93c4-5d70924f3e52',label:Untitled),timeRange:(from:'2025-12-31T00:00:00.000Z',to:'2026-12-07T00:00:00.000Z')))),objectType:search,title:'Untitled Discover session',version:'9.4.0')" } ``` </details> --------- Co-authored-by: Davis McPhee <davismcphee@hotmail.com> (cherry picked from commit 75954f1)
Contributor
|
/ci |
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
History
cc @doakalexi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation