How to compare fields of subevents in Logstash

Hi All,

I am new to ELK and i need one help with Logstash.
I am getting log from source and I have splitted that into sub events.
Events have one field in common and I want to compare current field to previous one.
Please suggest.