# Timelion: How to fill no data with the last value

**URL:** <https://discuss.elastic.co/t/timelion-how-to-fill-no-data-with-the-last-value/151528>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [October 8, 2018, 10:18pm UTC](https://discuss.elastic.co/t/timelion-how-to-fill-no-data-with-the-last-value/151528 "2018-10-08T22:18:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspang](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jspang](https://discuss.elastic.co/u/jspang)\
**Post date:** [October 8, 2018, 10:18pm UTC](https://discuss.elastic.co/t/timelion-how-to-fill-no-data-with-the-last-value/151528/1 "2018-10-08T22:18:09Z")

</div>

Our build system (Jenkins) sends all its data to Elasticsearch, which is fronted by Kibana.

I'm trying to build a simple timeline graph of our build system showing when the build is Green (healthy) or Red (broken). Here is a mock-up of what I'm aiming for:  
 ![graph](https://us1.discourse-cdn.com/elastic/original/3X/4/5/458335a2b66041a124185e2c0373abd16b0d8e5b.png)

I've been able to get most of the way there with the following Timelion code (timeframe=last 4 hours, scale=1m). The problem is that minutes that have no data are left blank. I need them to 'fill' with the last value.

```
(
.es(index=builds*, timefield='startTime',q='jobName:"myBuild" && status:"FAILURE"')
	.fit(carry)
	.color(red)
	.bars(),
.es(index=builds*, timefield='startTime', q='jobName:"myBuild" && status:"SUCCESS"')
	.fit(none)
	.color(green)
	.bars(),
)

```

As I understand it, the `.fit()` function should do what I need, but no matter which value I use for it, the graph does not change. It seems I can also use `.if()`, but I'm unable to figure out how to make it grab the last value for the series.

Here's what the graph I current have looks like. Any help filling in this whitespace would be great!

 ![timelion](https://us1.discourse-cdn.com/elastic/original/3X/5/4/54de81e5e86cd777b589d2579f3d8eb7e91148c6.png)

---

<div class="post-metadata">

**Author:** ![jspang](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jspang](https://discuss.elastic.co/u/jspang)\
**Post date:** [October 12, 2018, 6:41pm UTC](https://discuss.elastic.co/t/timelion-how-to-fill-no-data-with-the-last-value/151528/2 "2018-10-12T18:41:30Z")

</div>

Bump: Hoping there's a Timelion guru around here!

---

<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:** [November 9, 2018, 6:41pm UTC](https://discuss.elastic.co/t/timelion-how-to-fill-no-data-with-the-last-value/151528/3 "2018-11-09T18:41:34Z")

</div>

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