Update Reporting documentation: ES configuration, avoiding Token expiration (#208257)

## Summary

Closes https://github.com/elastic/kibana/issues/201281
Closes https://github.com/elastic/kibana/issues/200653

---------

Co-authored-by: wajihaparvez <wajiha.parvez@elastic.co>
This commit is contained in:
Tim Sullivan 2025-01-29 03:54:09 -07:00 committed by GitHub
parent 0b30b8e0b2
commit 5f59395f18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 2 deletions

View file

@ -31,6 +31,7 @@ to enable the {kib} server to have screenshotting capabilities.
* <<securing-reporting>>
* <<install-reporting-packages>>
* <<set-reporting-server-host>>
* <<reporting-elasticsearch-configuration>>
[float]
[[grant-user-access]]
@ -251,3 +252,10 @@ PDF/PNG reporting to reach {kib} over a local interface, while also allowing the
outward-facing network interfaces, as it makes the {kib} server accessible from any network interface on the
machine. Make sure that no firewall rules or other routing rules prevent local services from accessing this
address.
[float]
[[reporting-elasticsearch-configuration]]
=== Ensure {es} allows built-in templates
Reporting relies on {es} to install a mapping template for the data stream that stores reports. Ensure that {es} allows built-in
templates to be installed by keeping the `stack.templates.enabled` setting at the default value of `true`. For more information, see
{ref}/index-management-settings.html#stack-templates-enabled[Index management settings].

View file

@ -88,5 +88,18 @@ image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt4758e67aa
[[reporting-troubleshooting-csv-token-expired]]
=== Token expiration
To avoid token expirations, use a type of authentication that doesn't expire (such as Basic auth) or run the export using scripts that query Elasticsearch directly.
In a custom script, you have the ability to refresh the auth token as needed, such as once before each query.
A relatively common type of error seen for CSV exports is: `security_exception Root causes: security_exception: token expired`.
This error occurs in deployments that use token-based authentication (SAML tokens) when it takes too long to create the CSV report with the authentication cached in report job details.
This means that the deployment is stable, but the size of the requested report is too large to complete within the time allowed by the authentication token available to the Reporting task.
[float]
[[avoid-token-expiration]]
==== Avoiding token expiration
You can use the following workarounds for this error:
* Create smaller reports. Instead of creating one report that covers a large time range, create multiple reports that cover segmented time ranges.
* Increase `xpack.security.authc.token.timeout`, which is set to `20m` by default.
* To avoid token expirations completely, use a type of authentication that doesn't expire (such as Basic auth), or run the export using scripts that query {es} directly.