-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…41181) * [Docs/Reporting] Improve docs on automating Reporting (#40931) * [Docs/Reporting] Improve docs on automating Reporting * Update docs/reporting/automating-report-generation.asciidoc Co-Authored-By: gchaps <[email protected]> * Update docs/reporting/script-example.asciidoc Co-Authored-By: gchaps <[email protected]> * Update docs/reporting/script-example.asciidoc Co-Authored-By: gchaps <[email protected]> * --wip-- [skip ci] * word change * [DOCS] Fixes broken reporting links (#41195)
- Loading branch information
Showing
4 changed files
with
103 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
To automatically generate reports from a script, you'll make a request to the POST URL. | ||
The response from this request will be JSON, and will contain a `path` property with a | ||
URL to use to download the generated report when it is complete. | ||
|
||
The request method must be POST and it must include a `kbn-version` header for Kibana | ||
to allow the request. | ||
|
||
The following example queues CSV report generation using the POST URL with cURL: | ||
|
||
[source,shell] | ||
--------------------------------------------------------- | ||
curl \ | ||
-XPOST \ <1> | ||
-u elastic \ <2> | ||
-H 'kbn-version: 8.0.0' \ <3> | ||
'http://0.0.0.0:5601/api/reporting/generate/csv?jobParams=...' <4> | ||
--------------------------------------------------------- | ||
// CONSOLE | ||
|
||
<1> POST method is required. | ||
<2> Provide user credentials for a user with permission to access Kibana and X-Pack reporting. | ||
<3> The `kbn-version` header is required for all POST requests to Kibana. | ||
<4> The POST URL. You can copy and paste the URL for any report from the Kibana UI. | ||
|
||
Here is an example response: | ||
|
||
[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, | ||
"priority": 10 | ||
} | ||
} | ||
--------------------------------------------------------- | ||
// CONSOLE | ||
|
||
<1> The relative path on the Kibana host for downloading the report. | ||
<2> (Not included in the example) Internal representation of the reporting job, as | ||
found in the `.reporting-*` index. | ||
|
||
[IMPORTANT] | ||
=================== | ||
When using the `path` to request the download, you will get a 503 (Service Unavailable) | ||
response if report generation hasn't completed yet. In that case, retry after the | ||
number of seconds in the `Retry-After` header in the download API response until the | ||
report is complete. | ||
If there was an error in generating the report, the download URL will return a 500 | ||
(Internal Server Error) response. More information is available in the | ||
Reporting management page in Kibana: *Management > Kibana > Reporting* | ||
=================== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters