Can not filter & aggregate on date values


(Ole) #1

Hey folks,

I have a problem: I create a dynamic for some tracking data (JSON) index like this:

PUT test
{
"settings": {
    "index.mapping.ignore_malformed":true

  },
  "mappings": {
    "supersonic": {
      
          "dynamic": "true",
          "dynamic_templates": [
            {
               "dates": {
                  "match": ".*Date.*|.*date.*|.*timestamp.*|.*Timestamp.*",
                  "match_pattern": "regex",
                  "mapping": {
                     "type": "date"
                  }
               }
            }
          ]
        }
      }
    }
}

As soon as the first message hits the index, it is created like this:

{
  "test": {
    "aliases": {},
    "mappings": {
      "supersonic": {
        "dynamic": "true",
        "dynamic_templates": [
          {
            "dates": {
              "mapping": {
                "type": "date"
              },
              "match": ".*Date.*|.*date.*|.*timestamp.*|.*Timestamp.*",
              "match_pattern": "regex"
            }
          }
        ],
        "properties": {
          "battle_id": {
            "type": "string"
          },
          "current_hp": {
            "type": "double"
          },
          "date": {
            "type": "date",
            "format": "strict_date_optional_time||epoch_millis"
          },
          "entity_elements": {
            "type": "string"
          },
          "entity_type": {
            "type": "double"
          },
          "eventId": {
            "type": "double"
          },
          "gameId": {
            "type": "double"
          },
          "instanceId": {
            "type": "double"
          },
          "ipLong": {
            "type": "double"
          },
          "ipLongForwarded": {
            "type": "double"
          },
          "ipLongPeer": {
            "type": "double"
          },
          "networkId": {
            "type": "double"
          },
          "platform_id": {
            "type": "double"
          },
          "playerId": {
            "type": "string"
          },
          "pos_x": {
            "type": "double"
          },
          "pos_y": {
            "type": "double"
          },
          "room_x": {
            "type": "double"
          },
          "room_y": {
            "type": "double"
          },
          "stage_id": {
            "type": "double"
          },
          "timestamp": {
            "type": "date",
            "format": "strict_date_optional_time||epoch_millis"
          },
          "trevor_date": {
            "type": "date",
            "format": "strict_date_optional_time||epoch_millis"
          },
          "tsEventAccepted": {
            "type": "double"
          },
          "version": {
            "type": "string"
          }
        }
      }
    },
    "settings": {
      "index": {
        "creation_date": "1457095891176",
        "mapping": {
          "ignore_malformed": "true"
        },
        "uuid": "6qz6SDXIQQuof9XB6OaBQw",
        "number_of_replicas": "1",
        "number_of_shards": "5",
        "version": {
          "created": "2020099"
        }
      }
    },
    "warmers": {}
  }
}

The data arrives, is indexed, and everything looks fine in Kibana. But when I try to filter by a date (when I pick it from the right side, so it HAS to be there, or do a date histogram for example, it shows "No results found"

Nothing suspicious in the logs, I don't know how to investigate further :-/

I am using ES 2.2.0 and Kibana 4.4.1 and I am really grateful about any help, I already spent a lot of time on this and can't see why it won't work, since it's very very basic stuff.


(Ole) #2

An example JSON would be:

{
  "_index": "test",
  "_type": "supersonic",
  "_id": "AVNCNANiQbEmhEWmUojq",
  "_score": 1,
  "_source": {
    "instanceId": 0,
    "room_y": -76,
    "battle_id": "2016.02.15.10.48.10.7193440.7205372",
    "tsEventAccepted": 1455529989,
    "networkId": 0,
    "pos_y": -78,
    "timestamp": 1455529989,
    "trevor_date": 1455529989987,
    "gameId": 30,
    "ipLongPeer": 2130706433,
    "entity_type": 1100,
    "eventId": 949,
    "version": "5.3.1p1",
    "date": 1455529989,
    "ipLong": 3561950994,
    "current_hp": 50,
    "ipLongForwarded": 3561950994,
    "playerId": "Guest",
    "entity_elements": "BA_1_0_0_0_0",
    "pos_x": 24,
    "stage_id": 0,
    "platform_id": -1,
    "room_x": 23
  }
}

(system) #3