I haven't tried your code but the start date, must be subtracted from the finish date, try with this, haven't tested but should be fine:
duration = event.get('end_date').to_i - event.get('start_date').to_i
There is also a math filter for logstash if you like to try it.