What version of Logstash? If 5 or later see https://www.elastic.co/guide/en/logstash/current/event-api.html for how to get and set field values.
Also, you're using square brackets when you should be using parentheses.
((event['mrp'].to_i - event['price'].to_i).to_f / event['mrp'].to_f ) * 100