2023.01

2023.01

  • Imply
  • Ingest
  • Query
  • Visualize
  • Administer
  • Deploy

›Advanced features

Overview

  • Pivot overview
  • Datasources
  • SQL

Data cubes

  • About data cubes
  • Managing data cubes
  • Visualizations
  • Dimensions
  • Measures
  • Custom dimensions and measures
  • Time compare
  • Filter by measure
  • Annotations
  • Data export

Dashboards

  • Viewing dashboards
  • Creating dashboards
  • Managing dashboards

Alerts & Reports

  • Alerts
  • Scheduled reports

User access

  • Access control
  • User management in Pivot
  • Manage users with LDAP
  • Manage users with OIDC

Advanced features

  • Feature Flags
  • Customizing the Pivot UI
  • Generating links into Pivot
  • Monitor queries
  • Explain
  • CrossTab
  • Pivot server config
  • Plywood Expressions
  • Query parameters reference

Pivot API

  • Pivot API overview
  • Pivot users API
  • Pivot UserAuth API
  • Pivot user statuses API
  • Pivot roles API
  • Pivot connections API
  • Pivot data cubes API
  • Pivot dashboards API
  • Pivot alerts API
  • Pivot reports API

Generating links into Pivot

This information applies to on-prem Pivot instances only.

You can generate links that open to specific views from external systems by POSTing to /api/v1/mkurl.

The post body must include two keys:

# domain (string)

The domain on which Imply is running. It will simply be prefixed to the URL.

# essence (Essence)

The essence JSON that describes the state. The best way to understand what goes here is to see what calls the UI makes to /api/v1/mkurl/register, which utilizes the same mechanism described here to do URL shortening.

// generating a link
curl -X POST --header "Content-Type:application/json" --header "x-imply-api-token:<token>" --data '
{
  "domain": <domain name>,
  "essence": {<essence object>}
}
' localhost:9095/api/v1/mkurl

Examples:

input:

curl -X POST --header "Content-Type:application/json" --header "x-imply-api-token:ea750788-9ee5-4498-b2eb-ea25d7a62af5" --data '{
  "domain": "http://localhost:9095",
  "essence": {
    "dataCube": "wikipedia",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "dynamic": {
            "op": "timeRange",
            "operand": {
              "op": "ref",
              "name": "m"
            },
            "duration": "P1D",
            "step": -1
          }
        }
      ]
    },
    "splits": [],
    "selectedMeasures": ["count"],
    "pinnedDimensions": ["page"],
    "visualization": "totals"
  }
}' localhost:9095/api/v1/mkurl

output:

{ "url": "http://localhost:9095/pivot/d/63af9c7492ddc2273b/Wikipedia" }

More examples for Essence

Example 1

Here is an example that will show the totals visualization filtered dynamically on the last day with the count measure selected and the page dimension pinned.

{
  "domain": "http://localhost:9095",
  "essence": {
    "dataCube": "wikipedia",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "dynamic": {
            "op": "timeRange",
            "operand": {
              "op": "ref",
              "name": "m"
            },
            "duration": "P1D",
            "step": -1
          }
        }
      ]
    },
    "splits": [],
    "selectedMeasures": ["count"],
    "pinnedDimensions": ["page"],
    "visualization": "totals"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/63af9c7492ddc2273b/Wikipedia"
}

Example 2

Here is an example that will show the line-chart visualization filtered on the last 3 days of data (P3D), split on time (bucketed by hour - PT1H), with count, added, deleted, and delta measures selected.

{
  "domain": "http://localhost:9095",
  "essence": {
    "dataCube": "wikipedia",
    "visualization": "line-chart",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "dynamic": {
            "op": "timeRange",
            "operand": {
              "op": "ref",
              "name": "m"
            },
            "duration": "P1D",
            "step": -3
          }
        }
      ]
    },
    "splits": [
      {
        "dimension": "__time",
        "bucketAction": {
          "op": "timeBucket",
          "duration": "PT1H"
        }
      }
    ],
    "selectedMeasures": ["count", "added", "deleted", "delta"],
    "pinnedDimensions": []
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/2a9e32bb756240a298/Wikipedia"
}

Note: the $m variable represents maxTime - the timestamp of the latest data point. In contrast, $n represents 'now'.

Example 3

Here is an example that will also select some dimension filters:

{
  "domain": "http://localhost:9095",
  "essence": {
    "dataCube": "wikipedia",
    "timezone": "Etc/UTC",
    "filter": {
      "clauses": [
        {
          "dimension": "__time",
          "values": {
            "setType": "TIME_RANGE",
            "elements": [
              {
                "start": "2016-06-27T04:00:00.000Z",
                "end": "2016-06-27T18:00:00.000Z"
              }
            ]
          }
        },
        {
          "dimension": "channel",
          "action": "overlap",
          "values": {
            "setType": "STRING",
            "elements": [
              "#en.wikipedia",
              "#sh.wikipedia"
            ]
          }
        }
      ]
    },
    "splits": [
      {
        "dimension": "page",
        "sortType": "measure",
        "direction": "descending"
      }
    ],
    "selectedMeasures": ["count"],
    "pinnedDimensions": ["user"],
    "visualization": "table"
  }
}

Posting this will produce:

{
  "url": "http://localhost:9095/pivot/d/eaf8d548a39f9776e3/Wikipedia"
}
Last updated on 8/13/2020
← Customizing the Pivot UIMonitor queries →
2023.01
Key links
Try ImplyApache Druid siteImply GitHub
Get help
Stack OverflowSupportContact us
Learn more
Apache Druid forumsBlog
Copyright © 2023 Imply Data, Inc