Unable to run the default rollup job

Hi

I am trying to use rollup jobs to aggregate some queries. Here is my Elasticsearch version:

{
  "name" : "localhost-0",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "W6oclkz3SqK7GO3NnVyhGg",
  "version" : {
    "number" : "7.6.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
    "build_date" : "2020-03-26T06:34:37.794943Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

I am trying to run a rollup job using the following steps:

https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-getting-started.html

My data population looks like this:

curl -XPUT localhost:9200/sensor/_doc/3  -H 'Content-Type: application/json' -d'
{
   "timestamp": 1591138725,
   "temperature": 202,
   "voltage": 5.9,
   "node": "a"
}'

I am trying to create the job by doing the following:

curl -X PUT "localhost:9200/_rollup/job/sensor?pretty" -H 'Content-Type: application/json' -d'
{
    "index_pattern": "sensor",
    "rollup_index": "sensor_rollup",
    "cron": "*/30 * * * * ?",
    "page_size" :1000,
    "groups" : {
      "date_histogram": {
        "field": "timestamp",
        "fixed_interval": "60m"
      },
      "terms": {
        "fields": ["node"]
      }
    },
    "metrics": [
        {
            "field": "temperature",
            "metrics": ["min", "max", "sum"]
        },
        {
            "field": "voltage",
            "metrics": ["avg"]
        }
    ]
}
'

However, I am getting an error:

"reason" : "Validation Failed: 1: The field referenced by a date_histo group must be a [date] type across all indices in the index pattern.  Found: [long] for field [timestamp];2: Could not find a [date] field with name [timestamp] in any of the indices matching the index pattern.;3: The field [node] must be aggregatable across all indices, but is not.;"

This was the default example found in the documentation. Am I doing something wrong?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.