# Inserting logs with TimeStamp out of order

**URL:** <https://discuss.elastic.co/t/inserting-logs-with-timestamp-out-of-order/117638>\
**Category:** Elasticsearch\
**Created:** [January 30, 2018, 2:38pm UTC](https://discuss.elastic.co/t/inserting-logs-with-timestamp-out-of-order/117638 "2018-01-30T14:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbsf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pbsf/32/56616_2.png) [@pbsf](https://discuss.elastic.co/u/pbsf)\
**Post date:** [January 30, 2018, 2:38pm UTC](https://discuss.elastic.co/t/inserting-logs-with-timestamp-out-of-order/117638/1 "2018-01-30T14:38:48Z")

</div>

Previously, the `LogInfoEvent.TimeStamp` from my application used to be the UTC time the log message was received. Recently, I parameterized it to allow my application to insert logs of operations that occurred in the past, like a week ago.

I tested this feature on dev environment without any issues. A few weeks later though, Kibana started to give me the following error message "Discover: Gateway Timeout", saying that my Elastic Seach is unavailable.

Is modifying the `LogInfoEvent.TimeStamp` a bad practice, considering that I have the option "Index contains time-based events " checked on Kibana?

---

<div class="post-metadata">

**Author:** ![jpcarey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpcarey/32/46668_2.png) [@jpcarey](https://discuss.elastic.co/u/jpcarey)\
**Post date:** [January 30, 2018, 2:47pm UTC](https://discuss.elastic.co/t/inserting-logs-with-timestamp-out-of-order/117638/2 "2018-01-30T14:47:33Z")

</div>

A time field in elasticsearch comes in as a string and is parsed to timestamp based upon a pattern. If you modified the timestamp in such a way that the expected pattern is incorrect, the document could be rejected (default behavior). A timestamp is just a field within an index, order or values (beyond what I just mentioned) do not matter. You’ll want to check the health of the cluster and the elasticsearch logs to get a better idea of what is happening, as the problem you encountered could be many different issues.

---

<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:** [February 27, 2018, 2:47pm UTC](https://discuss.elastic.co/t/inserting-logs-with-timestamp-out-of-order/117638/3 "2018-02-27T14:47:47Z")

</div>

Closed on February 27, 2018, 2:47pm UTC

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