When exporting data as CSV from the Discover application, the job parameters use an absolute time range that was co-erced into the POST URL:
http://localhost:5601/api/reporting/generate/csv?jobParams=(conflictedTypesFields:!(),fields:!(_id,_index,_score,_type,search.columns,search.description,search.hits,search.kibanaSavedObjectMeta.searchSourceJSON,search.sort,search.title,search.version,type,updated_at),indexPatternId:%27918bb7f0-a497-11e8-8fe1-3991a3b1b556%27,metaFields:!(_source,_id,_type,_index,_score),searchRequest:(body:(_source:(excludes:!()),docvalue_fields:!(updated_at,url.accessDate,url.createDate),query:(bool:(filter:!(),must:!((match_all:()),(range:(updated_at:(format:epoch_millis,gte:1534808045652,lte:1534811645652)))),must_not:!(),should:!())),script_fields:(),sort:!((_score:(order:desc))),stored_fields:!(%27*%27),version:!t),index:%27*%27),title:%27New%20Saved%20Search%27,type:search)
Time range portion appears to be: range:(updated_at:(format:epoch_millis,gte:1534808045652,lte:1534811645652))
In contrast, PDF export from Dashboard appears to have the desired behavior:
http://localhost:5601/api/reporting/generate/printablePdf?jobParams=(browserTimezone:America%2FToronto,layout:(id:print),objectType:dashboard,relativeUrls:!(%27%2Fapp%2Fkibana%23%2Fdashboard%2F98aee040-a495-11e8-8fe1-3991a3b1b556%3F_g%3D(refreshInterval:(display:Off,pause:!!f,value:0),time:(from:now-1h,mode:quick,to:now))%26_a%3D(description:!%27!%27,filters:!!(),fullScreenMode:!!f,options:(darkTheme:!!f,hidePanelTitles:!!f,useMargins:!!t),panels:!!((embeddableConfig:(),gridData:(h:15,i:!%271!%27,w:24,x:0,y:0),id:!%2700f9e390-17e0-11e8-bf14-c9dbfc6e6269!%27,panelIndex:!%271!%27,type:visualization,version:!%276.3.1!%27),(embeddableConfig:(),gridData:(h:15,i:!%272!%27,w:24,x:24,y:0),id:!%2712d5aed0-cc60-11e7-aadb-7b129851f054!%27,panelIndex:!%272!%27,type:visualization,version:!%276.3.1!%27),(embeddableConfig:(),gridData:(h:15,i:!%273!%27,w:24,x:0,y:15),id:!%27248ac390-cc60-11e7-aadb-7b129851f054!%27,panelIndex:!%273!%27,type:visualization,version:!%276.3.1!%27)),query:(language:lucene,query:!%27!%27),timeRestore:!!f,title:!%27New%2BDashboard!%27,viewMode:view)%27),title:%27New%20Dashboard%27)
Time range portion appears to be: time:(from:now-1h,mode:quick,to:now)
Relative range is necessary when automating report generation from watcher, for example, if we want to generate a CSV and send to email every day, we need to have now-1d to now as the range.
As a workaround, the URL could be modified by hand like so:
http://localhost:5601/api/reporting/generate/csv?jobParams=(conflictedTypesFields:!(),fields:!(_id,_index,_score,_type,search.columns,search.description,search.hits,search.kibanaSavedObjectMeta.searchSourceJSON,search.sort,search.title,search.version,type,updated_at),indexPatternId:%27918bb7f0-a497-11e8-8fe1-3991a3b1b556%27,metaFields:!(_source,_id,_type,_index,_score),searchRequest:(body:(_source:(excludes:!()),docvalue_fields:!(updated_at,url.accessDate,url.createDate),query:(bool:(filter:!(),must:!((match_all:()),(range:(updated_at:(gte:now-1d,lte:now)))),must_not:!(),should:!())),script_fields:(),sort:!((_score:(order:desc))),stored_fields:!(%27*%27),version:!t),index:%27*%27),title:%27New%20Saved%20Search%27,type:search)
However URLs should be copied as generated.
When exporting data as CSV from the Discover application, the job parameters use an absolute time range that was co-erced into the POST URL:
Time range portion appears to be:
range:(updated_at:(format:epoch_millis,gte:1534808045652,lte:1534811645652))In contrast, PDF export from Dashboard appears to have the desired behavior:
Time range portion appears to be:
time:(from:now-1h,mode:quick,to:now)Relative range is necessary when automating report generation from watcher, for example, if we want to generate a CSV and send to email every day, we need to have
now-1dtonowas the range.As a workaround, the URL could be modified by hand like so:
However URLs should be copied as generated.