# Loading records with date\_range field from Logstash

**URL:** <https://discuss.elastic.co/t/loading-records-with-date-range-field-from-logstash/86299>\
**Category:** Logstash\
**Created:** [May 18, 2017, 3:43pm UTC](https://discuss.elastic.co/t/loading-records-with-date-range-field-from-logstash/86299 "2017-05-18T15:43:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisbeck](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@chrisbeck](https://discuss.elastic.co/u/chrisbeck)\
**Post date:** [May 18, 2017, 3:43pm UTC](https://discuss.elastic.co/t/loading-records-with-date-range-field-from-logstash/86299/1 "2017-05-18T15:43:05Z")

</div>

I have a set of data with a start date/time and an end date/time. I would like to create a date\_range field via a filter clause in logstash as part of inserting the data.

has anyone been able to do this?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [May 29, 2017, 8:12pm UTC](https://discuss.elastic.co/t/loading-records-with-date-range-field-from-logstash/86299/2 "2017-05-29T20:12:29Z")

</div>

According to the docs, a date\_range field named `X` should have the following form:

```nohighlight
"X" : { 
  "gte" : "2015-10-31 12:00:00", 
  "lte" : "2015-11-01"
}

```

You can e.g. use a date filter to populate the `gte` and `lte` subfields.

---

<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:** [June 26, 2017, 8:12pm UTC](https://discuss.elastic.co/t/loading-records-with-date-range-field-from-logstash/86299/3 "2017-06-26T20:12:35Z")

</div>

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