Skip to content

Commit

Permalink
Provide example that shows how to properly encode sql url
Browse files Browse the repository at this point in the history
(cherry picked from commit 893cbac)
  • Loading branch information
nickanderson committed Feb 21, 2020
1 parent 3b92eee commit 80d5563
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions enterprise-cfengine-guide/reporting/reporting_ui.markdown
Expand Up @@ -12,9 +12,18 @@ If you are familiar with SQL syntax, you can input your query into the interface

You can share the report with other users - either by using "Save" button, or by base64-encoding the report query into a URL. You can also provide an optional title by adding `title` parameter to the URL, like this:

```
https://hub/index.php/advancedreports/#/report/run?sql=U0VMRUNUIEhvc3RzLkhvc3RLZXkgQVMgIkhvc3Qga2V5IiwgSG9zdHMuSG9zdE5hbWUgQVMgIkhvc3QgbmFtZSIgRlJPTSBIb3N0cw==&title=Sample%20Report
```
```console
HUB_URL="https://hub"
API="/index.php/advancedreports/#/report/run?sql="
SQL_QUERY="SELECT Hosts.HostName AS 'Host Name' FROM Hosts"
REPORT_TITLE="Example Report"
LINK="${HUB_URL}${API}$(echo ${SQL_QUERY} | base64)&title=$(/usr/bin/urlencode ${REPORT_TITLE})"
echo "${LINK}"
```

```
https://hub/index.php/advancedreports/#/report/run?sql=U0VMRUNUIEhvc3RzLkhvc3ROYW1lIEFTICdIb3N0IE5hbWUnIEZST00gSG9zdHMK&title=Example%20Report
```

You can query fewer hosts with the help of filters above the displayed table. These filters are based on the same categorization you can find in the other apps.

Expand Down

0 comments on commit 80d5563

Please sign in to comment.