kibana/docs/reporting/automating-report-generation.asciidoc
Tim Sullivan b2cd01e1be
[Docs/Reporting] More information about HTTP / script stuff (#41200)
* [Docs/Reporting] More information about HTTP / script stuff

* "post url" formatting consistency

* consistent wording from 1 paragraph to another

* Update docs/reporting/response-codes.asciidoc

Co-Authored-By: gchaps <33642766+gchaps@users.noreply.github.com>

* pr feedback

* subs=attributes, version in command example

* "Retry-After" content

* another feedback
2019-07-18 14:41:43 -07:00

62 lines
2 KiB
Text

[role="xpack"]
[[automating-report-generation]]
== Automating Report Generation
You can automatically generate reports with {watcher}, or by submitting
HTTP `POST` requests from a script.
include::report-intervals.asciidoc[]
[float]
=== Getting the POST URL
Generating a report either through Watcher or a script requires capturing the **POST
URL**, which is the URL to queue a report for generation.
To get the URL for triggering PDF report generation during a given time period:
. Load the saved object in the Visualize editor, or load a Dashboard.
. Use the timepicker to specify a relative or absolute time period.
. Click *Share* in the Kibana toolbar.
. Select *PDF Reports*.
. Click **Copy POST URL**.
To get the URL for triggering CSV report generation during a given time period:
. Load a saved search in Discover.
. Use the timepicker to specify a relative or absolute time period.
. Click *Share* in the Kibana toolbar.
. Select *CSV Reports*.
. Click **Copy POST URL**.
[float]
=== Using Watcher
include::watch-example.asciidoc[]
[float]
=== Using a Script
include::script-example.asciidoc[]
[float]
=== HTTP Response Codes
include::response-codes.asciidoc[]
[float]
== Deprecated Report URLs
The following POST URL paths were once supported but are now deprecated. If there are
any problems with using these paths after upgrading Kibana's version, you should use
{kib} to re-generate the POST URL for a particular report.
* Dashboard Reports: `/api/reporting/generate/dashboard/<dashboard-id>`
* Visualization Reports: `/api/reporting/generate/visualization/<visualization-id>`
* Saved Search Reports: `/api/reporting/generate/search/<saved-search-id>`
[IMPORTANT]
===================
Previously there was a `&sync` parameter appended to generation URLs which would hold
the request open until the document was fully generated. This feature has been removed.
Existing use of the `&sync` parameter, in Watcher for example, will need to be updated.
===================