Get and visualize job execution average duration

Hi,

I am trying to visualize job execution average duration in hours in Kibana.

I query source Duration field from SQL server in Unix format with LogStash filter:

filter{
date {
match => [ "duration", "UNIX" ]
target => "duration1"
}
}

For example if source epoch number is 9132 instead of 03:56:11 I get full date in the output "1970-01-01T03:56:11.000Z".

How could I filter data to target only to get time (without date) and visualize job execution average duration in hours in Kibana?

Or should I choose different approach for average duration visualization?

Thanks

any update?

Why not just visualize the job duration in seconds in Kibana?

If you really want to use hours you can convert using a ruby filter.

    ruby {
        code => '
            d = event.get("duration")
            if d
                event.set("duration1", d.to_f / 3600)
            end
        '
    }
1 Like

Thanks Badger,

it worked and now average is displayed in 4,45 format,

is any way how to change this duration format to 'HH:mm:ss' after Kibana calculates duration average?

Thanks

I do not know. That is a kibana question, not a logstash question.

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