# Creating visualization with timestamp un y axis and not count

**URL:** <https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430>\
**Category:** Kibana\
**Created:** [June 20, 2023, 6:27am UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430 "2023-06-20T06:27:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anusha\_Kusanghi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anusha_kusanghi/32/98109_2.png) [@Anusha\_Kusanghi](https://discuss.elastic.co/u/Anusha_Kusanghi)\
**Post date:** [June 20, 2023, 6:27am UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/1 "2023-06-20T06:27:42Z")

</div>

Hi All,

We have a index which stores the status of job running in controlm platform , like job name ,id ,job start time end time and so on...  
We want to create a visualization: putting date in y axis (date on which date job executed)  
and end\_time in x-axis.  
example of on how the graph should look like:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7969c1daa69dc05c04f515cc55de377e938c1df.png)

Here is a sample log message:

```auto
  "_source": {
    "due_in": "0558",
    "state": null,
    "max_rerun": 0,
    "due_out": "0559",
    "task_type": "Job",
    "memname": "TD94A143",
    "ind_cyclic": "E",
    "order_lib": "CONTROLM.TD94A1.PROD.SCHEDULE",
    "summary": "TD94A143/20230619173054/GRWL9/0",
    "cyclic": "0",
    "avg_start_time": "241437",
    "lpar": " ",
    "job_id": "35154",
    "description": "UPDATE TIMESTAMP AMC S USED IN LAST RUN RL00000000",
    "elapsed": 1,
    "job_name": "TD94A143",
    "task_class": " ",
    "end_time": "2023-06-19T22:30:58.000Z",
    "max_wait": 10,
    "rerun_mem": " ",
    "application": "WINKSTOC",
    "to_time": ">",
    "prev_odate_rerun_counter": 0,
    "critical": "0",
    "@timestamp": "2023-06-19T15:30:54.000Z",
    "status": "Ended OK",
    "type": "controlmxpslogs",
	"split_ts_by_date": "20-Jun-2023"

  }

```

We always get count on y-axis but here it not our requirement how can we achieve this.  
let me know for more information.

TIA

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [June 20, 2023, 8:51am UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/2 "2023-06-20T08:51:30Z")

</div>

Hi Anusha,  
this seems like a non-trivial case and I am not sure if using Lens you can achieve exactly what you want because you want to work with non-aggregated data. However we can get pretty close. What I would try to do is to create an extra runtime field to convert end\_time to number and make sure that the end\_time is comparable across the executions. Here's the screenshot of what I did to create runtime field:

I took a @timestamp field, converted it to a number of milliseconds, then used a modulo function to only get the time of the day (86400000 is the number of ms in the day).

 ![Screenshot 2023-06-20 at 10.48.56](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b13280a640c1df9a8c58576785c2431b94be87d0.jpeg)

Then I set the format duration as in the screenshot. I then can use this value on my chart as a `maximum` or `last value`.  
The problem is that you are unable to print a pretty hh:mm format, you will instead get a fraction of the hour (so instead of 12:30, 12.5). Currently I don't see a solution for it in Lens.

 ![Screenshot 2023-06-20 at 10.51.17](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb2864f8a084f4ddb2c987b8cab3f37b15335f24.png)

You could try Vega, but it's not trivial.

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [June 20, 2023, 8:57am UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/3 "2023-06-20T08:57:25Z")

</div>

Hi Anusha, a small correction, you can actually achieve what you want, I forgot about one feature we could use here. Firstly, we need to slightly change our runtime field to get the number of seconds instead of milliseconds (remember changing te script AND the format):

 ![Screenshot 2023-06-20 at 10.56.34](https://us1.discourse-cdn.com/elastic/original/3X/7/2/72ee7ebcefe9d37716f7d45fc8d0fa11ba7122e9.png)

Then you can use a custom format in your visualization:

 ![Screenshot 2023-06-20 at 10.55.06](https://us1.discourse-cdn.com/elastic/original/3X/0/8/0895511c9a3c29f9f56b8ab9f4ce9c69384fb980.png)

Let me know if that's helpful!

---

<div class="post-metadata">

**Author:** ![Anusha\_Kusanghi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anusha_kusanghi/32/98109_2.png) [@Anusha\_Kusanghi](https://discuss.elastic.co/u/Anusha_Kusanghi)\
**Post date:** [June 20, 2023, 2:19pm UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/4 "2023-06-20T14:19:40Z")

</div>

Hi Marta,

Thanks a lot for the suggestions , This is a potential solution.  
I tried to follow the steps given by you but i dont see custom format for 'end\_time\_converted' fiels

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6007b646ad5fcfb15327c7d9894046239a70320.png)

We are using elastic 7.17.5 version, which version your using?

And we also want a job name/id to be shown with different color coding or job name if we hover over the graph.  
Regards,  
Anusha K

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [June 20, 2023, 2:54pm UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/5 "2023-06-20T14:54:27Z")

</div>

Aaaah, you are right, custom format is added to the upcoming 8.9 version. So till then you cannot use it and the only option is to have a fraction of the hour here.

When it comes to the color coding for the job, you have to create breakdown by dimension. You can either use top values which will take the most used values from your documents or you can specifically list your jobs by using the filters. Examples below.

 ![Screenshot 2023-06-20 at 16.53.36](https://us1.discourse-cdn.com/elastic/original/3X/9/7/9791c4f6f36e88bc202a3251af3b7103697f911e.png)  
 ![Screenshot 2023-06-20 at 16.54.07](https://us1.discourse-cdn.com/elastic/original/3X/1/2/12dec8ba03ba0d0230e8b0004e3e49eb49c11a62.png)

---

<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:** [July 18, 2023, 2:55pm UTC](https://discuss.elastic.co/t/creating-visualization-with-timestamp-un-y-axis-and-not-count/336430/6 "2023-07-18T14:55:11Z")

</div>

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