Convert cloudflare unix nanoseconds timestamp to elastic search date time field

(Palanikumar K) #1

Hi Team,

Im facing trouble in converting unix nanoseconds to elastic search date time field. Please let me know how to create indices and import this data.

 "mappings": {
  "doc": {
   "properties": {
    "CacheCacheStatus": {"type": "string"},
	"CacheResponseBytes": {"type": "integer"},
	"CacheResponseStatus": {"type": "integer"},
	"CacheTieredFill":{"type": "boolean"},
        "EdgeStartTimestamp": {"type": "date"}



While importing into elastic search im getting below error.

    "create" : {
      "_index" : "cloudflare-2018.09.01",
      "_type" : "log",
      "_id" : "AWX7EQH50J_kGrzSCN-5",
      "status" : 400,
      "error" : {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse [EdgeStartTimestamp]",
        "caused_by" : {
          "type" : "illegal_argument_exception",
          "reason" : "Invalid format: \"1535759912620000000\" is malformed at \"759912620000000\""

(Alexander Reelsen) #2


Elasticsearch does not yet have support for timestamps in nanosecond resolution. You could use an ingest pipeline to shorten the date accordingly, so that it fits within millisecond resolution.


(system) #3

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