0

I want to import some data with curl to the rest endpoint. I need to use a user defined schema described in the docs, but I have some issues with specifying timestamp format.

This is a minimal example of what I'm sending:

curl -i \
-F schema='[{"name":"ts", "type": "TIMESTAMP", "format": "YYYY-MM-DD HH:MM:SS"},{"name":"instance_id", "type": "STRING"}]' \
-F data=@log_out.csv \
http://localhost:9000/imp

Columns are being imported correctly, but the timestamp column looks broken:

ts instance_id
NULL EU-1XX
NULL EU-1XX
NULL EU-2XX
funnymay
  • 341
  • 1
  • 6

1 Answers1

0

When using the user-defined schema with TIMESTAMP types, you should be using pattern instead of format in the schema query parameter, i.e.:

curl -i \
-F schema='[{"name":"ts", "type": "TIMESTAMP", "pattern": "YYYY-MM-DD HH:MM:SS"},{"name":"instance_id", "type": "STRING"}]' \
-F data=@log_out.csv \
http://localhost:9000/imp
Brian Smith
  • 1,222
  • 7
  • 17