Timestamp format using _ingest in incorrect form on metricbeat rollups

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.

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