# Historical trend chart (project related)

**URL:** <https://discuss.elastic.co/t/historical-trend-chart-project-related/141309>\
**Category:** Kibana\
**Created:** [July 24, 2018, 6:54am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309 "2018-07-24T06:54:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![delly.fofie](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@delly.fofie](https://discuss.elastic.co/u/delly.fofie)\
**Post date:** [July 24, 2018, 6:54am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/1 "2018-07-24T06:54:25Z")

</div>

Hello!  
We are using Kibana to display the evolution of the projects. A project in our case is a set of requirements with different States for e.g (In preparation, Approved, Implemented).  
This image show an example:

 ![2018-07-24_08h46_01](https://us1.discourse-cdn.com/elastic/original/3X/5/0/50fe931e9d580562487246e184718dc31b8b1926.png)

The problem is, on 20.07.2018, we are storing the objects with their corresponding states, so total object is **7**  
But on 21.07.2018, the first object's(o1) state changed from **implemented** to **approved**.  
And whe have liked Kibana/Timelion to display in area trend charts the correct counts for each day for the three States.

I see here two possibilities:

1. Re-importing the data every day (Not only the one which change) -\> Data grow to fast.
2. Maintaining a second index which store a count for each given state on a daily based -\> User can only see the count and not the objects).

Is there another elegant way to solve that? Any Idea ?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [July 24, 2018, 7:22am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/2 "2018-07-24T07:22:08Z")

</div>

Hi delly,

Not sure that i completely understand the issue, but I will try.

You can import the data every day using something like Logstash easily. Creating a new record every day should easily allow you to create a trend chart. Is there any issue in doing so?

---

<div class="post-metadata">

**Author:** ![delly.fofie](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@delly.fofie](https://discuss.elastic.co/u/delly.fofie)\
**Post date:** [July 24, 2018, 7:27am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/3 "2018-07-24T07:27:13Z")

</div>

> [@NerdSec](#):
>
> You can import the data every day using something like Logstash easily. Creati

Which records are you saving on the second day ? Not the one which changed ? Or the whole set ?  
Thake a look again at the image I attached to the post, how can you let elasticsearch know that on 21.07 it remains:  
**2 objects with the implemented state**?

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [July 24, 2018, 7:51am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/4 "2018-07-24T07:51:06Z")

</div>

Hi,

You should index all records each day. Elasticsearch indices are usually time-based, so the timestamp would be the time of ingestion in elasticsearch.

Now, when you create a visualization in Kibana, you can select the timestamp to something like "Current Day". This will allow you to see the status of your projects as on date. For trends, you can select a longer time period, thereby enabling you to see the older data.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![delly.fofie](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@delly.fofie](https://discuss.elastic.co/u/delly.fofie)\
**Post date:** [July 24, 2018, 8:00am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/5 "2018-07-24T08:00:01Z")

</div>

> [@NerdSec](#):
>
> e

thanks for your reply. It's not a how Elasticsearch/Kibana works questions. But mainly on how to structure the data in order to get the trend chart i want. What you are explaining here is mostly how to set up kibana/ES

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [July 24, 2018, 8:11am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/6 "2018-07-24T08:11:29Z")

</div>

correct!

You could also assign a unique id to each project and then consume it daily, but then all data will be over-written and you would not be able to show the trends.

---

<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:** [August 21, 2018, 8:11am UTC](https://discuss.elastic.co/t/historical-trend-chart-project-related/141309/7 "2018-08-21T08:11:38Z")

</div>

Closed on August 21, 2018, 8:11am UTC

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