Easy Pivot Logo
  • Pricing

Manual

OverviewFolder SystemData Sources
User and RoleRestful Interfaces

Integration

Dataset

Elasticsearch Dataset

Elasticsearch Dataset

To reduce dependencies on ES versions and third-party ES libraries, CBoard adopts a restful + DSL connection and query mode. Therefore, using ES requires users (especially modelers) to have some understanding of basic ES concepts and also master some DSL syntax.
ES query parameters need to be precise to the Type. Index names can use wildcards, following the same principle as ES DSL query URL parameters.
Since most data stored in ES is detailed data, when aggregating by time dimension, the granularity needs to be adjusted to a time interval (date_histogram). The default aggregation level is term (keyword), so the aggregation granularity needs to be adjusted before using time dimension aggregation.

Aggregation Override

CBoard provides three types of common Bucket aggregation override assist inputs. For specific configurable parameters, please refer to the official documentation: Bucket Aggregations

  1. date_hist: Date histogram aggregation
  2. number_range: Number range aggregation
  3. number_hist: Number histogram

Syntax (multiple column aggregations can be overridden repeatedly):
{
  "columnname":{
    "<aggregation_type>" : {
      <aggregation_body>
    }
  }
}
---------------------------------
Example:
Aggregate the timestamp field (long type) in 10-minute intervals, and aggregate the numeric memory field with a custom range.
{
  "timestamp": {
    "date_histogram": {
      "field": "timestamp",
      "format": "yyyy-MM-dd HH:mm:ss",
      "interval": "10m",
      "time_zone": "+08:00"
    }
  },
  "memory": {
    "range": {
      "field": "memory",
      "ranges": [
        {
          "to": 10000
        },
        {
          "from": 10000,
          "to": 30000
        },
        {
          "from": 30000
        }
      ]
    }
  }
}

Date Field + Interval

Used for generating index date suffixes and query filtering based on the index. This feature is for maintenance and may not be very stable.

When a date field is set, the default index naming follows the pattern: indexName-yyyy.MM.dd.

  • When fetching fields, a wildcard path is used: http://localhost:9200/index_name-*/_mapping
  • For query searches, if the date field does not have a filter condition, the default date component is used: http://localhost:9200/index_name-2023.01.01,index_name-2023.01.02,index_name-2023.01.03/_mapping
  • When the date field has a filter condition, the date suffix is automatically generated based on the filter condition.

TimeZone

Index date timezone configuration. Supports configurations like +02:00 or timezone names like Asia/Shanghai.

Global Filter Conditions

You can set one or multiple global filter conditions. Built-in date variables can be used within filter conditions to achieve dynamic global filtering.

{
  "range": {
    "time": {
      "gt": "${cdt.addMonth(-1, 'yyyy-MM-dd')}"
    }
  }
}
[
  {
    "range": {
      "time": {
        "gt": "xx"
      }
    }
  },
  {
    "term": {
      "status": "published"
    }
  }
]

Script Derived Dimension Configuration

The aggregation override settings mentioned earlier are applied at the dataset query level, equivalent to a global query column aggregation override. If you want to apply multiple bucketing strategies to a single column, you can reference the optional column multiple times in the Schema tree and then edit the custom information.

{
  "esBucket": {
    "<aggregation_type>" : {
      <aggregation_body>
    }
  }
}

Important

esBucket is a built-in keyword and cannot be replaced.

Advanced Aggregation Expressions

Besides conventional aggregate statistics, ES aggregation expressions also support Filter Aggregation, used for conditional statistics or static proportions.

Syntax:
count/sum/avg/max/min("{
  'column': 'Column used for aggregation',
  'filter': <filter_body>
}")
-------------------------------
count("{
    'column': 'orderId',
    'filter': {
        'term': {
          'order.platform': 'online'
        }
    }
}")

On this page

Aggregation OverrideDate Field + IntervalTimeZoneGlobal Filter ConditionsScript Derived Dimension ConfigurationAdvanced Aggregation Expressions
Log InStart Free