How to clean field which contains a date value

I have documents like

{
 "mydate" : "\/Date(1553767871903)\/",
 "myvalue" : 100
}

in field mydate, date exists in epoch_second (/Date(1553767871903)/).
How can I clean up the characters I dont need and set field mydate to "format" : "date" during indexing process. Lastly I need mydate to draw a Data Histogramm in Kibana.

regards

This here at least lead to the desired result.
However, now I have a further field named "mydate"

POST _ingest/pipeline/_simulate
{
    "pipeline": { 
    "description": "cork_pipeline",
    "processors": [
      {
      "grok": {
        "field": "date",
        "patterns": ["(?<mydate>[0-9]+)"]
      }
        }
    ]
  },
  "docs" : [{
    "_source": {
    "date": "\/Date(1553767771903)\/"
   }
  }]
}

Respond

{
  "docs": [
    {
      "doc": {
        "_index": "_index",
        "_type": "_type",
        "_id": "_id",
        "_source": {
          "date": "/Date(1553767771903)/",
          "mydate": "1553767771903"
        },
        "_ingest": {
          "timestamp": "2019-04-09T13:40:38.753Z"
        }
      }
    }
  ]
}

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