|
2 | 2 | [[automating-report-generation]] |
3 | 3 | == Automatically generate reports |
4 | 4 |
|
5 | | -To automatically generate PDF and CSV reports, generate a POST URL, then submit the HTTP `POST` request using {watcher} or a script. |
| 5 | +To automatically generate PDF and CSV reports, generate a POST URL, then submit an HTTP `POST` request using {watcher} or a script. Alternatively, use {kib} to generate reports on a recurring schedule and share them with a list of emails that you specify. |
6 | 6 |
|
7 | 7 | [float] |
8 | 8 | [[create-a-post-url]] |
9 | 9 | === Create a POST URL |
10 | 10 |
|
11 | 11 | Create the POST URL that triggers a report to generate PDF and CSV reports. |
12 | 12 |
|
| 13 | +[float] |
| 14 | +[[pdf-png-post-url]] |
| 15 | +==== PDF or PNG reports |
| 16 | + |
13 | 17 | To create the POST URL for PDF reports: |
14 | 18 |
|
15 | | -. Go to *Dashboards*, *Visualize Library*, or *Canvas*. |
| 19 | +. Go to *Dashboards*, *Visualize Library*, or *Canvas*. From the toolbar, do one of the following: |
16 | 20 |
|
17 | | -. Open the dashboard, visualization, or **Canvas** workpad you want to view as a report. |
| 21 | +. Open the dashboard, visualization, or **Canvas** workpad you want to view as a report. |
18 | 22 |
|
19 | | -* If you are using *Dashboard* or *Visualize Library*, from the toolbar, click *Share > Export*, select the PDF option then click *Copy POST URL*. |
| 23 | +** If you are using *Dashboard* or *Visualize Library*, from the toolbar, click the **Export** icon, then **PDF** or **PNG**. In the export flyout, copy the POST URL. |
| 24 | +** If you are using a *Canvas* workpad, from the toolbar, click *Share > PDF Reports*, then click *Advanced options > Copy POST URL*. |
20 | 25 |
|
21 | | -* If you are using *Canvas*, from the toolbar, click *Share > PDF Reports*, then click *Advanced options > Copy POST URL*. |
| 26 | +[float] |
| 27 | +[[csv-post-url]] |
| 28 | +==== CSV reports |
22 | 29 |
|
23 | 30 | To create the POST URL for CSV reports: |
24 | 31 |
|
25 | 32 | . Go to *Discover*. |
26 | 33 |
|
27 | 34 | . Open the saved Discover session you want to share. |
28 | 35 |
|
29 | | -. In the toolbar, click *Share > Export > Copy POST URL*. |
| 36 | +. In the toolbar, click the **Export** icon, then **CSV**. In the export flyout, copy the POST URL. |
30 | 37 |
|
31 | 38 | [float] |
32 | 39 | [[use-watcher]] |
@@ -58,3 +65,89 @@ If you experience issues with the deprecated report URLs after you upgrade {kib} |
58 | 65 |
|
59 | 66 | IMPORTANT: |
60 | 67 | In earlier {kib} versions, you could use the `&sync` parameter to append to report URLs that held the request open until the document was fully generated. The `&sync` parameter is now unsupported. If you use the `&sync` parameter in Watcher, you must update the parameter. |
| 68 | + |
| 69 | +[float] |
| 70 | +[[schedule-report-generation]] |
| 71 | +=== Schedule and share reports |
| 72 | + |
| 73 | +preview::[] |
| 74 | + |
| 75 | +Save time by setting up a recurring task that automatically generates reports and shares them on a schedule that you choose. |
| 76 | + |
| 77 | +[float] |
| 78 | +[[scheduled-reports-reqs]] |
| 79 | +==== Prerequisites |
| 80 | + |
| 81 | +* To generate PDF and PNG reports, your {kib} instance needs a minimum of 2GB of RAM. There is no minimum requirement for CSV reports. |
| 82 | +* To use the scheduled reports feature, your role needs <<grant-user-access, access to reporting>>. |
| 83 | +* (Optional) To view and manage other users' reports and schedules, your role needs `All` privileges for the **Manage Scheduled Reports** feature. You can set this by configuring your role's {kib} privileges. If your role doesn't have the **Manage Scheduled Reporting** feature privilege, you can only share reports with yourself. |
| 84 | +* Sharing reports outside of {kib} requires a default preconfigured email connector. |
| 85 | ++ |
| 86 | +** **{ech} or {serverless-short} users**: You do not need to set up a default preconfigured email connector. Kibana provides you with a built-in preconfigured email connector that uses the SMTP protocol to send emails. To view it, go to the **Connectors** page and find the Elastic-Cloud-SMTP connector. |
| 87 | +** **Self-managed users**: You must set up a default preconfigured email connector to send notifications outside of {kib}. To do this: |
| 88 | ++ |
| 89 | +. Open your `kibana.yml` file. |
| 90 | +. Add the `xpack.actions.preconfigured` {kib} setting. This setting specifies configuration details for the preconfigured connector that you're defining. |
| 91 | +. Under the `xpack.actions.preconfigured` setting, define the email connector. Refer to <<preconfigured-email-configuration>> to learn about requirements for different email services and providers. |
| 92 | ++ |
| 93 | +NOTE: You must define preconfigured email connector details in the `kibana.yml` file. You cannot create a preconfigured email connector from the {kib} UI. |
| 94 | ++ |
| 95 | +. Add the `notifications.connectors.default.email` {kib} setting, and provide the name of your email connector. The `notifications.connectors.default.email` setting specifies the default email connector to use when sending notifications. This is especially useful if you have multiple email connectors and want to set a default one. |
| 96 | ++ |
| 97 | +The following example shows a modified `kibana.yml` file with a preconfigured email connector that's set as the default connector for email notifications: |
| 98 | ++ |
| 99 | +[source,yaml] |
| 100 | +---- |
| 101 | +xpack.actions.preconfigured: |
| 102 | + my-email: |
| 103 | + name: preconfigured-email-connector-type |
| 104 | + actionTypeId: .email |
| 105 | + config: |
| 106 | + service: other |
| 107 | + |
| 108 | + host: validhostname |
| 109 | + port: 8080 |
| 110 | + secure: false |
| 111 | + hasAuth: true |
| 112 | + secrets: |
| 113 | + user: testuser |
| 114 | + password: passwordkeystorevalue |
| 115 | +
|
| 116 | +notifications.connectors.default.email: my-email |
| 117 | +---- |
| 118 | + |
| 119 | +* (Optional) To control who can receive email notifications from {kib}, add the <<action-settings, `xpack.actions.email.domain_allowlist` setting>> to your `kibana.yml` file. |
| 120 | + |
| 121 | +[float] |
| 122 | +[[create-scheduled-report]] |
| 123 | +==== Create a schedule |
| 124 | +. Open the saved Discover session, dashboard, or visualization you want to share. |
| 125 | +. Click the **Export** icon, then **Schedule export**. |
| 126 | +. Enter the requested details, and (optional) enable **Print format** to generate the report in a printer-friendly format. |
| 127 | +. Set up a schedule for generating the report. |
| 128 | + |
| 129 | + * **Date**: Choose when to start generating reports. |
| 130 | + * **Timezone**: Specify a timezone for the schedule. |
| 131 | + * **Repeat**: Choose how often you want to generate reports. |
| 132 | + |
| 133 | +. (Optional) To share generated reports outside of {kib}, enable **Send by email** and enter a list of email addresses. Recipients will receive emails with the generated reports attached and on the schedule that you specified. |
| 134 | ++ |
| 135 | +NOTE: If your role doesn't have the **Manage Scheduled Reporting** feature privilege, you can only send reports to yourself. |
| 136 | ++ |
| 137 | +. Click **Schedule exports** to save the schedule. |
| 138 | + |
| 139 | +A message appears, indicating that the schedule is available on the **Reporting** page. From the **Reporting** page, click on the **Schedules** tab to view details for the newly-created schedule. |
| 140 | + |
| 141 | +IMPORTANT: Note that you cannot edit or delete a schedule after you create it. To stop the schedule from running, you must disable it. Disabling a schedule permanently stops it from running. To restart it, you must create a new schedule. |
| 142 | + |
| 143 | +[float] |
| 144 | +[[scheduled-reports-limitations]] |
| 145 | +==== Scheduled reports limitations |
| 146 | + |
| 147 | +The feature enables analysis of data in external tools, but it is not intended for bulk export or to backup {es} data. Issues with report generation and sharing are likely to happen in the following scenarios: |
| 148 | + |
| 149 | +* The limit for email attachments is 10 MB. {kib} might fail to attach reports that are larger than this size. |
| 150 | +* Scheduling too many reports at the same time might cause reports to be shared late or at an inconsistent schedule. {kib} Task Manager runs reporting tasks one at a time. |
| 151 | +* If your cluster is running many tasks in general, reports may be delayed. |
| 152 | +* Scheduling reports of Canvas workpads is not supported since Canvas workpads are in maintenance mode. |
| 153 | +* Scheduling CSV reports of Lens visualizations is not supported. |
0 commit comments