Relative time range does not copy in URL #48897
Labels
bug
Fixes for quality problems that affect the customer experience
(Deprecated) Feature:Reporting
Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead
Kibana version: 7.2
Elasticsearch version: 7.2
Describe the bug:
The button on a saved search window: Share -> CSV -> 'Copy POST Url' generates a URL that will always have an absolute date range even if you have a relative range specified. This is an issue because these URLs are often used in Watcher to run scheduled reports or, in this case, a scheduled CSV export of data. The generated URL will cause the Watch to always return the same data set regardless of when the watch was ran.
For example. This is the resultant URL when exporting a saved search in CSV format using the 'Copy POST Url' :
https://XXXXXX:YYYYY/api/reporting/generate/csv?jobParams=(conflictedTypesFields:!(),fields:!(%27@timestamp%27,src_user,src),indexPatternId:%XXXXXXXXXXXXXX,metaFields:!(_source,_id,_type,_index,_score),searchRequest:(body:(_source:(excludes:!(),includes:!(%27@timestamp%27,src_user,src)),docvalue_fields:!(),query:(bool:(filter:!((bool:(filter:!((bool:(minimum_should_match:1,should:!((match_phrase:(msg:%27XXX%20XXX*%27))))),(bool:(minimum_should_match:1,should:!((match_phrase:(action:%27XXX%20in%27))))))))),must:!((exists:(field:alarm_name)),(
range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272019-10-14T18:11:58.934Z%27,lte:%272019-10-21T18:11:58.934Z%27)))),must_not:!(),should:!())),script_fields:(),sort:!((%27@timestamp%27:(order:desc,unmapped_type:boolean))),stored_fields:!(%27@timestamp%27,src_user,src),version:!t),index:%27XXXXXXXXX-*%27),title:%27XXX%20%7C%20XXX%20XXX%20-%XXXXX%20XXXXXX%27,type:search)
See here for screenshot that shows what was used to create this URL. ^
Steps to reproduce:
Expected behavior:
The URL generated would have a dynamic range where the 'Now' is when the Watch is ran. This is exactly what happens when you are on a Dashboard page and select: Share -> PDF Reports -> Copy Post URL.
Dashboard PDF Report Export Url:
https://XXXXX:9243/api/reporting/generate/printablePdf?jobParams=(browserTimezone:America%2FNew_York,layout:(dimensions:(height:960,width:1855),id:preserve_layout),objectType:dashboard,relativeUrls:!(%27%2Fapp%2Fkibana%23%2Fdashboard%XXXX-d884-11e9-b33d-XXXXXXX%3F_g%3D(refreshInterval:(pause:!!t,value:0),
time:(from:now-7d,to:now))%26_a%3D(description:!%27!%27,filters:!!(),fullScreenMode:!!f,options:(hidePanelTitles:!!f,useMargins:!!t),panels:!!((embeddableConfig:(),gridData:(h:13,i:!%271!%27,w:24,x:0,y:0),id:c0f0a3b0-d629-11e9-b33d-XXXXXXX,panelIndex:!%271!%27,title:!%27SSL%2BXXXXXXX%2B-%2BXXXXXXX%2BXXXXXXX!%27,type:search,version:!%277.2.0!%27),(embeddableConfig:(),gridData:(h:13,i:!%272!%27,w:23,x:24,y:0),id:!%276f4e32a0-d969-11e9-b33d-XXXXXXX!%27,panelIndex:!%272!%27,title:!%27GOLD%2B-%2BXXXXXXX%2BXXXXXXX!%27,type:visualization,version:!%277.2.0!%27),(embeddableConfig:(),gridData:(h:21,i:!%274!%27,w:47,x:0,y:13),id:!%277d15c410-d96a-11e9-b33d-XXXXXXX!%27,panelIndex:!%274!%27,title:!%27SSL%2BXXXXXXX%2B%2B-%2BTop%2BXXXXXXX%2BXXXXXXX!%27,type:visualization,version:!%277.2.0!%27)),query:(language:kuery,query:!%27!%27),timeRestore:!!f,title:!%27General%2B%257C%2B-%2BXXXXXXX%2BXXXXXXX!%27,viewMode:view)%27),title:%27General%20%7C%20-%20XXXXXXX%20XXXXXXX%27)
Screenshots (if relevant):
Any additional context:
The text was updated successfully, but these errors were encountered: