Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting] CSV Export URL generation adds an absolute time range filter #122575

Closed
lucabelluccini opened this issue Jan 10, 2022 · 3 comments · Fixed by #123206
Closed

[Reporting] CSV Export URL generation adds an absolute time range filter #122575

lucabelluccini opened this issue Jan 10, 2022 · 3 comments · Fixed by #123206
Assignees
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@lucabelluccini
Copy link
Contributor

lucabelluccini commented Jan 10, 2022

Kibana version: 7.16.1

Elasticsearch version: Aligned

Describe the bug:

CSV Export URL contains an unexpected time filter, which is not present at the time of the visualization.

Steps to reproduce:

  1. Create an index pattern which contains data during the last N days. I've used .monitoring-es*
  2. Choose Last 24h in the timepicker (note the URL contains only (filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h%2Fh,to:now))&_a=(columns:!(),filters:!(),index:'10881820-3b02-11eb-a646-7340c405390d',interval:auto,query:(language:kuery,query:''),sort:!(!(timestamp,desc)))
  3. Save the Saved Search - The URL still shows (filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h%2Fh,to:now))&_a=(columns:!(),filters:!(),grid:(),hideChart:!f,index:'10881820-3b02-11eb-a646-7340c405390d',interval:auto,query:(language:kuery,query:''),sort:!(!(timestamp,desc)))
  4. Go on Share / CSV Export / Copy POST URL
  5. You'll get .../api/reporting/generate/csv_searchsource?jobParams=%28browserTimezone%3AEurope%2FDublin%2Ccolumns%3A%21%28%29%2CobjectType%3Asearch%2CsearchSource%3A%28fields%3A%21%28%28field%3A%27%2A%27%2Cinclude_unmapped%3Atrue%29%29%2Cfilter%3A%21%28%28meta%3A%28field%3Atimestamp%2Cindex%3A%2710881820-3b02-11eb-a646-7340c405390d%27%2Cparams%3A%28%29%29%2Cquery%3A%28range%3A%28timestamp%3A%28format%3Astrict_date_optional_time%2Cgte%3Anow-24h%2Fh%2Clte%3Anow%29%29%29%29%2C%28meta%3A%28field%3Atimestamp%2Cindex%3A%2710881820-3b02-11eb-a646-7340c405390d%27%2Cparams%3A%28%29%29%2Cquery%3A%28range%3A%28timestamp%3A%28format%3Astrict_date_optional_time%2Cgte%3A%272022-01-09T18%3A00%3A00.000Z%27%2Clte%3A%272022-01-10T18%3A14%3A50.694Z%27%29%29%29%29%29%2Cindex%3A%2710881820-3b02-11eb-a646-7340c405390d%27%2Cparent%3A%28filter%3A%21%28%29%2Cindex%3A%2710881820-3b02-11eb-a646-7340c405390d%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27%27%29%29%2Csort%3A%21%28%28timestamp%3Adesc%29%29%2CtrackTotalHits%3A%21t%29%2Ctitle%3Ademo-csv-export%2Cversion%3A%277.16.1%27%29

URL Decoded params:

(browserTimezone:Europe/Dublin,columns:!(),objectType:search,searchSource:(fields:!((field:'*',include_unmapped:true)),filter:!((meta:(field:timestamp,index:'10881820-3b02-11eb-a646-7340c405390d',params:()),query:(range:(timestamp:(format:strict_date_optional_time,gte:now-24h/h,lte:now)))),(meta:(field:timestamp,index:'10881820-3b02-11eb-a646-7340c405390d',params:()),query:(range:(timestamp:(format:strict_date_optional_time,gte:'2022-01-09T18:00:00.000Z',lte:'2022-01-10T18:14:50.694Z'))))),index:'10881820-3b02-11eb-a646-7340c405390d',parent:(filter:!(),index:'10881820-3b02-11eb-a646-7340c405390d',query:(language:kuery,query:'')),sort:!((timestamp:desc)),trackTotalHits:!t),title:demo-csv-export,version:'7.16.1')

We can see there's an additional query which passes the "current" time, meaning this URL cannot be used for automated reports except manually trimming away the second range query (query:(range:(timestamp:(format:strict_date_optional_time,gte:'2022-01-09T18:00:00.000Z',lte:'2022-01-10T18:14:50.694Z')))).

Note that reloading the saved search, the additional time range filter is not present. Only the relative filter is present.

Expected behavior:

Generate a CSV Export URL which only includes the relative timepicker.

Workaround:

Manually edit the URL to remove the additional unwanted time filter.

@lucabelluccini lucabelluccini added the bug Fixes for quality problems that affect the customer experience label Jan 10, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 10, 2022
@lucabelluccini lucabelluccini added Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Jan 10, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 10, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesSv)

@kertal kertal added the (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead label Jan 11, 2022
@exalate-issue-sync exalate-issue-sync bot changed the title CSV Export URL generation adds an absolute time range filter [Reporting] CSV Export URL generation adds an absolute time range filter Jan 13, 2022
@exalate-issue-sync exalate-issue-sync bot added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Jan 13, 2022
@tsullivan tsullivan self-assigned this Jan 14, 2022
@tsullivan
Copy link
Member

Root cause: this seems to be introduced by #119583

@dmitriynj @kertal could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Feature:Discover Discover Application impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants