Time between timestamp

I just found out elapsed wont help me as it wont give difference of every timestamp in log file, is their any other way , script filter of elasticsearch or anything ?? i just need a way so that i can plot difference of timestamps in a bar chart , so that maximum difference will automatically show that something is weird in logs .