kibana/docs/user/reporting/script-example.asciidoc
Kaarina Tungseth 524fe6dfe2
[DOCS] Updates to the Reporting docs (#101326)
* [DOCS] Updates to thee Reporting docs

* Adds the main sharing page

* Final changes

* Changed configuring-reporting link to secure-reporting

* Updates from meeting with Tim and Larry

* Moves reporting and sharing content above ML

* Update docs/setup/configuring-reporting.asciidoc

Co-authored-by: Larry Gregory <lgregorydev@gmail.com>

* Review comments from Tim and Larry

* Fixes broken links

* Fixes redirect

* Fixes broken link from ES docs

* Adds metadata to changed pages

* Review comments

Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
2021-06-30 12:10:04 -05:00

41 lines
1.6 KiB
Text

To automatically generate reports from a script, make a request to the `POST` URL. The request returns a JSON and contains a `path` property with a
URL that you use to download the report. Use the `GET` method in the HTTP request to download the report.
To queue CSV report generation using the `POST` URL with cURL:
["source","sh",subs="attributes"]
---------------------------------------------------------
curl \
-XPOST \ <1>
-u elastic \ <2>
-H 'kbn-xsrf: true' \ <3>
'http://0.0.0.0:5601/api/reporting/generate/csv?jobParams=...' <4>
---------------------------------------------------------
// CONSOLE
<1> The required `POST` method.
<2> The user credentials for a user with permission to access {kib} and {report-features}.
<3> The required `kbn-xsrf` header for all `POST` requests to {kib}. For more information, refer to <<api-request-headers, API Request Headers>>.
<4> The POST URL. You can copy and paste the URL for any report.
An example response for a successfully queued report:
[source,json]
---------------------------------------------------------
{
"path": "/api/reporting/jobs/download/jxzaofkc0ykpf4062305t068", <1>
"job": {
"id": "jxzaofkc0ykpf4062305t068",
"index": ".reporting-2018.11.11",
"jobtype": "csv",
"created_by": "elastic",
"payload": ..., <2>
"timeout": 120000,
"max_attempts": 3
}
}
---------------------------------------------------------
// CONSOLE
<1> The relative path on the {kib} host for downloading the report.
<2> (Not included in the example) Internal representation of the reporting job, as found in the `.reporting-*` index.