1

I've just started using the rest api to put documents into ElasticSearch having always used Logstash to do this in the past.

How do I get ES to recognise dates when I pass it a string or integer? I've tried both 13 digit "millis since epoc" (as string and integer) format and yyyyMMddTHHmmss.SSSZ (ISO 8601) format. Neither seem to get parsed.

Looking at documents that Logstash has successfully indexed, it seems to use the "millis since epoc" method, and I know those indexes are dynamically created. Submitting mappings for each index is not an option for me.

Any ideas? Thanks.

1 Answer 1

2

Date detection is covered in detail in the dynamic field mapping section of the documentation.

By default, either yyyy/MM/dd HH:mm:ss Z or yyyy/MM/dd Z can be used, but you can customize that further on a per-index basis if you want.

Sign up to request clarification or add additional context in comments.

1 Comment

Cheers, that's done it .NET: DateTime.ToString("O") is picked up correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.