Query to access distinct fields from different documents


(Gautam) #1

Hi all,

I have two documents representing the start and end jobs of a batch respectively.

Here the field p_job_name represents the parent job and the field job_name represents the names of the sub jobs of the respective parent job. The fields start and end represent the start and end times of each job.

I want to calculate the complete batch time which would be (End job).end - (Start job).start.

When I use the script: doc['end'].value - doc['start'].value, I get the timings of the individual jobs (in minutes) which is shown in the job_time field.

I am unable to extract the end time of End job and the start time of Start job as part of a single query.

My aim is to obtain the overall batch time which would be : 596.683 mins

Could you please help me out?

Thanks in advance


(Gautam) #2

I think I can solve this problem using the logstash elapsed plugin but I'm not able to install the plugin. I'll start a new topic in the logstash category.


Unable to install the elapsed plugin on windows
(Makoto Nozawa) #3

Hi,

I think it is a kind of relationship issue.
So this page may help you.
https://www.elastic.co/guide/en/elasticsearch/guide/current/relations.html


(system) #4

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