I have a log file containing a series of jobs along with start and end time for each job. I have parsed the log file using logstash and converted the start and end times into timestamp fields. In order to calculate the time for each job, I created a scripted field named job_time defined as:
doc['end_time'].value - doc['start_time'].value
I need to create a bar graph with job_name and job_time as the axes. The vertical bar chart in Kibana's visualize tab only provides aggregate operations like count, sum, average as the Y-axis. I am unable to set job_time as the Y-axis. Could you please help me out?
I would like to have job_name on Y-axis and its corresponding job_time on x-axis or vice versa. I don't think I need any aggregation for this but the visualize tab insists on selecting an aggregation
I think the closest that you're going to get is having the job_name on the x-axis and the job_time on the y-axis. However, you'll have to choose an aggregation to use for the y-axis. It might be beneficial for us to take a step back, as I'm not sure if this is going to give you exactly what you're looking for.
So, you have jobs that are running that have a job_name and a job_time, are you looking to get an entire history of the jobs running and their time, or are you looking for an average/sum of the job_time?
@Brandon_Kobel
Each job has a set of sub jobs, each of which may again have a set of sub jobs. I'm looking to get the entire history of jobs running such that I can drill down or roll up to different jobs on different levels to get the the corresponding job times on the various levels.
Here is my discussion with @Mark_Harwood on the same.
My final intention is to obtain something like JDiskReport but for figuring out where time goes, not disk space.
For your specific use-case, I'd recommend using an x-axis terms aggregation on job_name and a y-axis sum aggregation on job_time, this will give you a chart with the total time spent grouped by job.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.