Logstash - elapsed seconds to something human-readable

Good morning,

I'm using Logstash with elapsed plugin to calculate the time between two timestamps. It works perfectly and the field is a Number in seconds.

Is there a way to create a new field with that value in a human readable way? I need the seconds field to make some statistics (number of elapsed seconds in a month, for example), but I need another field to read the value (74685 seconds to something like "20 hours, 44 minutes and 45 seconds".

I tried to convert the field to date and to use date filter, but it doesn't work.

I think that the biggest elapsed time will have months.

Thank you so much,

You can do it in a ruby filter. Take a look at this.

Thank you so much for your reply. I'll create a file and I will call it form the ruby filter!

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