# Configure Heartbeat to check date in JSON response body

**URL:** <https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [December 16, 2019, 8:40am UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958 "2019-12-16T08:40:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuerisee](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zuerisee](https://discuss.elastic.co/u/zuerisee)\
**Post date:** [December 16, 2019, 8:40am UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958/1 "2019-12-16T08:40:29Z")

</div>

Hello everybody,

I was wondering if it's possible to use Heartbeat to parse and check a date within a JSON response body against the current date.

In this case I'd like to check if date is older than 2 weeks.

```
{
    "text":"Lorem ipsum dolor",
    "date":"2019-12-11T14:02:50"
}

```

The [docs](https://www.elastic.co/guide/en/beats/heartbeat/6.8/configuration-heartbeat-options.html) don't mention anything like this.

I'm using Heartbeat 6.8 with Elasticsearch 6.8.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [December 16, 2019, 12:32pm UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958/2 "2019-12-16T12:32:55Z")

</div>

Hey @zuerisee and welcome 🙂

It is possible to add checks on JSON objects, but at the moment I am afraid that [there is no condition](https://www.elastic.co/guide/en/beats/heartbeat/7.5/defining-processors.html#conditions) that can be used for expressions with dates or numbers.

It'd be great if you could open a [new enhancement request](https://github.com/elastic/beats/issues/new?template=feature-request.md) with your use case, thanks!

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [December 16, 2019, 12:44pm UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958/3 "2019-12-16T12:44:50Z")

</div>

We have an open issue to let users use Javascript to script advance checks like these already: [https://github.com/elastic/beats/issues/13982](https://github.com/elastic/beats/issues/13982)

Would that work as a fix here?

---

<div class="post-metadata">

**Author:** ![zuerisee](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zuerisee](https://discuss.elastic.co/u/zuerisee)\
**Post date:** [December 16, 2019, 3:53pm UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958/4 "2019-12-16T15:53:18Z")

</div>

@jsoriano  
Thank you very much for the explanation and the warm welcome.

@Andrew_Cholakian1  
That would be a great feature to have! Do you have any estimate on a release date? Looking very much forward to it.

---

<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:** [January 13, 2020, 3:53pm UTC](https://discuss.elastic.co/t/configure-heartbeat-to-check-date-in-json-response-body/211958/5 "2020-01-13T15:53:25Z")

</div>

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