diff --git a/explore-analyze/discover/try-esql.md b/explore-analyze/discover/try-esql.md index f2b7791314..dfd2f01b3c 100644 --- a/explore-analyze/discover/try-esql.md +++ b/explore-analyze/discover/try-esql.md @@ -362,6 +362,11 @@ Variable controls help you make your queries more dynamic instead of having to m You can add them from your Discover {{esql}} query. +:::{note} +:applies_to: {"stack": "ga 9.5", "serverless": "ga"} +When you generate a [CSV report](/explore-analyze/report-and-share.md#csv-limitations) from a Discover session or a Discover session panel on a dashboard, the exported data reflects the values currently selected in the variable controls. This applies to both immediate and scheduled reports. +::: + :::{include} ../_snippets/variable-control-procedure.md ::: diff --git a/explore-analyze/report-and-share/reporting-troubleshooting-csv.md b/explore-analyze/report-and-share/reporting-troubleshooting-csv.md index a39642405a..2ac7af9876 100644 --- a/explore-analyze/report-and-share/reporting-troubleshooting-csv.md +++ b/explore-analyze/report-and-share/reporting-troubleshooting-csv.md @@ -86,6 +86,19 @@ The listing of reports in **Stack Management > Reporting** allows you to inspect ::: +## ES|QL variable control errors [reporting-troubleshooting-csv-esql-variables] + +Generating a CSV report from an {{esql}} query that references a [variable control](/explore-analyze/discover/try-esql.md#add-variable-control), such as `?crew_id`, can fail with an error like: + +```txt +parsing_exception: Unknown query parameter [crew_id] +``` + +This occurs on versions where the reporting task didn't pass the selected control values through to the query. It was resolved in 9.5.0 and backported to the 8.19, 9.3.9, and 9.4.4 patch releases, so that reports now run with the values currently selected in the controls. + +To work around the error on an earlier version, upgrade to a version that includes the fix, or replace the variable references in the query with fixed values before you export. + + ## Token expiration [reporting-troubleshooting-csv-token-expired] A relatively common type of error seen for CSV exports is: `security_exception Root causes: security_exception: token expired`.