elasticsearchkibanaelasticsearch-aggregationelasticsearch-7kibana-7

`timestamp` field is invalid for use with the "Date Histogram" aggregation


Having issue viewing indices in Kibana 7.x due to

Error: Saved field "value.request.timestamp" of index pattern "flight-cache-*" is invalid for use with the "Date Histogram" aggregation. Please select a new field.

The document json looks something like (removed irrelevant properties):

{
  "value": {
    "request": {
        "timestamp": 1638345701217
    }
  }
}

The index mapping looks something like (simplified as well)

{
  "properties": {
    "value": {
       {
          "request": {
            "type": "nested",
            "properties": {
              "timestamp": {
                "format": "epoch_millis",
                "type": "date"
              }
            }
         }
      }
    }
  }
}

Please help. Thanks!

Full error:

Error: Saved field "value.request.timestamp" of index pattern "flight-cache-*" is invalid for use with the "Date Histogram" aggregation. Please select a new field.
    at FieldParamType.e.write.write (http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:362451)
    at http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:324984
    at Array.forEach (<anonymous>)
    at d (http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:324961)
    at AggConfig.write (http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:313717)
    at AggConfig.toDsl (http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:314404)
    at http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:141519
    at Array.forEach (<anonymous>)
    at agg_configs_AggConfigs.toDsl (http://localhost:5601/46307/bundles/plugin/data/kibana/data.plugin.js:1:140620)
    at http://localhost:5601/46307/bundles/plugin/discover/kibana/discover.chunk.2.js:1:199214

Screenshot:

enter image description here


Solution

  • It turns out Kibana does not support using timestamp under a nested property.

    Changing request.type to object solved the problem.