kovas6
(kovas)
March 25, 2019, 4:00pm
1
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
Badger
March 28, 2019, 4:08pm
3
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
kovas6
(kovas)
April 9, 2019, 11:49am
4
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
Badger
April 9, 2019, 11:51am
5
I do not know. That is a kibana question, not a logstash question.
system
(system)
Closed
May 7, 2019, 11:51am
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.