# Heartbeat HTTP monitor evaluate a Date JSON response Field

**URL:** <https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [May 5, 2022, 7:12am UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999 "2022-05-05T07:12:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mktbec](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mktbec](https://discuss.elastic.co/u/mktbec)\
**Post date:** [May 5, 2022, 7:12am UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/1 "2022-05-05T07:12:17Z")

</div>

Hi everyone

I need to evaluate a Date field in a JSON response with a heartbeat monitor. it look like there is a date() option using gval, but I can't make it work.

the HTTP response looks like this.

```auto
{
  "syncTables" : {
    "version" : "2022-05-05T08:59:59.629"
    }
}

```

and I need to evaluate that the date in the version field isn't older than 1 day, because then there is a problem with the sync scheduler on the Web service.

I look forward to hear for you.

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:** [May 5, 2022, 4:12pm UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/2 "2022-05-05T16:12:03Z")

</div>

Sorry to hear you've hit a stumbling block here @mktbec .

TBH, this isn't a use case we handle that well at the moment, I don't suspect it's possible since we don't parse that string as a date.

We are looking at [multi-step API journeys](https://github.com/elastic/synthetics/issues/137), as something for our mid to long term roadmap. At the moment our focus is on the synthetics service. Ultimately, I think you'll want the full power of scripting to do these checks right.

For now, the best answer with our current stack would be to do a browser based check and parse the JSON source, though that's very clunky.

---

<div class="post-metadata">

**Author:** ![mktbec](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mktbec](https://discuss.elastic.co/u/mktbec)\
**Post date:** [May 5, 2022, 5:22pm UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/3 "2022-05-05T17:22:55Z")

</div>

Hi Andrew

Thanks for your response!  
I appreciate that a lot!

It is possible for us to change the date-string value to a real date value, would that help?

best regards 🙂

---

<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:** [May 5, 2022, 7:27pm UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/4 "2022-05-05T19:27:07Z")

</div>

Unfortunately the JSON format doesn't actually have its own notion of dates. What people usually do is encode ISO8601 dates into strings, but we don't actually handle that in a special way.

---

<div class="post-metadata">

**Author:** ![mktbec](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mktbec](https://discuss.elastic.co/u/mktbec)\
**Post date:** [May 6, 2022, 6:58am UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/5 "2022-05-06T06:58:21Z")

</div>

Hi Andrew

okay, thanks for your time and answers

---

<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 3, 2022, 8:58am UTC](https://discuss.elastic.co/t/heartbeat-http-monitor-evaluate-a-date-json-response-field/303999/6 "2022-06-03T08:58:54Z")

</div>

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