# Timestamp format using \_ingest in incorrect form on metricbeat rollups

**URL:** https://discuss.elastic.co/t/timestamp-format-using-ingest-in-incorrect-form-on-metricbeat-rollups/196005
**Category:** Elasticsearch
**Created:** [August 20, 2019, 9:01pm UTC](https://discuss.elastic.co/t/timestamp-format-using-ingest-in-incorrect-form-on-metricbeat-rollups/196005 "2019-08-20T21:01:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![EricJohnson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericjohnson/32/53592_2.png) [@EricJohnson](https://discuss.elastic.co/u/EricJohnson)
#### Post date: [August 20, 2019, 9:01pm UTC](https://discuss.elastic.co/t/timestamp-format-using-ingest-in-incorrect-form-on-metricbeat-rollups/196005/1 "2019-08-20T21:01:24Z")

</div>

Hello!

I'm using the ingest pipeline API to add a field I'm calling "record\_date" that should present the time that a rollup occurs in YYYY-MM-DD format. The API call to add the new field is working but the field is shows something like 'Aug 27, 2019 @ 17:56:40.000' rather than '2019-08-27.'

Here is the API PUT to create the new field:

```
PUT (hostname):9200/_ingest/pipeline/timestamp_format
{
"description": "Format timestamps as YYYY-MM-DD",
	"processors": [
		{
			"date" : {
            	"field": "record_date",
            	"target_field": "record_date",
            	"formats": ["UNIX_MS", "yyyy/MM/dd"]
        }
  }]
}

```

And here is part of the API call to put the new field in action for the index called 'cpu\_all\_hourly2\_rollup' with some sample data:

```
POST (hostname):9200/cpu_all_hourly2/_doc/?pipeline=timestamp_format&pretty
{
"_rollup.id": "cpu_all_hourly2_rollup",
"system.cpu.system.pct.histogram._count": 81,
"system.cpu.irq.pct.value_count.value": 0,
"system.cpu.steal.pct.histogram.interval": 5,
(etc.)
"record_date": 1566950200000,
"system.cpu.irq.pct.histogram.value": null,
"system.cpu.user.pct.histogram._count": 81,
"system.cpu.irq.pct.histogram.interval": 5,
}

```

I've tried to find ways of changing the format of the field but nothing is working. I can't find the answer in any documentation from Elastic either. Presumably the issue is with this part:

```
"formats": ["UNIX_MS", "yyyy-MM-dd"]

```

Any input will be greatly appreciated! Thank you.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 17, 2019, 9:01pm UTC](https://discuss.elastic.co/t/timestamp-format-using-ingest-in-incorrect-form-on-metricbeat-rollups/196005/2 "2019-09-17T21:01:36Z")

</div>

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