# Figure out when, during the day, something usually happens?

**URL:** <https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579>\
**Category:** Kibana\
**Created:** [August 31, 2019, 1:01am UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579 "2019-08-31T01:01:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [August 31, 2019, 1:01am UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/1 "2019-08-31T01:01:29Z")

</div>

I've got a record of every time my 3 month old was fed (and how much) almost since birth. So far feedings have been completely driven by hunger. Now, we'd like to try easing into a schedule.

I'd like to be able to visualize when feedings typically occur during the day. I'm thinking some kind of... scatter plot maybe? Where X is time of day (12:00am-11:59pm) and Y is total ounces? Maybe that's not the best way though. Can anyone help me out?

The data looks like this:

```
{
  "_index": "formula",
  "_type": "_doc",
  "_id": "703",
  "_version": 1,
  "_score": null,
  "_source": {
    "Time": "8/30/19 4:49 PM",
    "Amount": "5.6 oz.",
    "Note": "",
    "Timestamp": 1567198140000,
    "Ounces": 5.6
  },
  "fields": {
    "Timestamp": [
      "2019-08-30T20:49:00.000Z"
    ]
  },
  "sort": [
    1567198140000
  ]
}

```

My drawing is a bit childish, but this is what I imagine it looking like... I just have no idea how to create it: ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a43f8c61c7a54a425905bd082a096edebd38f323.png)

Also, I guess I should add that I have a script to export, parse, munge, and then load each datapoint into elasticsearch, so if I need to tweak or add something to each datapoint to make this easier, that's not a problem.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 6, 2019, 10:42am UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/2 "2019-09-06T10:42:37Z")

</div>

If you create a field (either scripted field in kibana) or in your script that imports the data that has the Hour of day as a value, you could then do a Histogram on that field on the X-axis ( with a 1h interval maybe - depends on how much accuracy you would want here).

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [September 6, 2019, 1:19pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/3 "2019-09-06T13:19:22Z")

</div>

Oh, hey, that's a pretty interesting idea. I never really thought about it from that direction, but I'm sure it will work. Thank you @Marius_Dragomir!

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 6, 2019, 2:30pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/4 "2019-09-06T14:30:29Z")

</div>

It sounds like an interesting thing to do with Elastic, if you have a blog post or something that you're writing about this, it'd be cool if you could post it here.

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [September 6, 2019, 2:44pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/5 "2019-09-06T14:44:52Z")

</div>

Well, I'm not a big fan of broadcasting what I do generally, so I don't have a blog or anything, but here's a picture of my first attempt using your hours idea:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a5c4b7439dbc9afdc0d8434dbcc233181d879ac.png)  
That only shows the past 100 days, and it probably needs a little more resolution, but it's really clear that 5, 8, 12, and 3pm are prime candidates for scheduled feedings. Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [September 6, 2019, 3:14pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/6 "2019-09-06T15:14:53Z")

</div>

If you have a trial for premium features available, you could try running this through the Anomaly Detection and Forecasting in Machine Learning. Could get some interesting result.

---

<div class="post-metadata">

**Author:** ![cgmelastic](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cgmelastic](https://discuss.elastic.co/u/cgmelastic)\
**Post date:** [September 6, 2019, 3:16pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/7 "2019-09-06T15:16:58Z")

</div>

I am just spinning it up in a docker cluster. I will look into that stuff though, thanks 🙂

---

<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:** [October 4, 2019, 3:16pm UTC](https://discuss.elastic.co/t/figure-out-when-during-the-day-something-usually-happens/197579/8 "2019-10-04T15:16:59Z")

</div>

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