0

When we create time-based indices, elasticsearch/kibana need a field named "_timestamp".

I found that this field should be a string.

But in my log, Unix Timestamp is a necessary segment.

1 Answer 1

3

Yes you can store unix timestamp in Date type fields. But make sure you use proper format like epoch_millis for timestamp in millis and epoch_second for timestamp in seconds.

Example mapping for timestamp field which stores unix timestamp in seconds.

PUT my-index
{
  "mappings": {
    "my-type": {
      "properties": {
        "timestamp": {
          "type": "date",
          "format": "epoch_second"
        }
      }
    }
  }
}

You can find more information here

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

Comments

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.