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:
Here is a sample log message:
"lpar": " ",
"description": "UPDATE TIMESTAMP AMC S USED IN LAST RUN RL00000000",
"task_class": " ",
"rerun_mem": " ",
"status": "Ended OK",
We always get count on y-axis but here it not our requirement how can we achieve this.
let me know for more information.
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).
Then I set the format duration as in the screenshot. I then can use this value on my chart as a
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.
You could try Vega, but it's not trivial.
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):
Then you can use a custom format in your visualization:
Let me know if that's helpful!
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
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.
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.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.