Given this input :
_time,app,eventguid,text
1346449414,1,123,some more text
1346449424,1,456,other stuff
1346449434,2,123,some more text
1346449436,2,456,other stuff
1346449436,3,123,some more text
1346449439,3,456,other stuff
This
| inputlookup example.csv
| streamstats global=f current=f window=1 first(_time) as ptime first(app) as papp by eventguid
| where isnotnull(ptime)
| eval dur=_time-ptime
| eval papp="app".papp."_duration"
| chart first(dur) over eventguid by papp
Produces this
eventguid app1_duration app2_duration
123 20 2
456 12 3
I'm making a few assumtions
you have to use the time of the event to workout the duration as the transaction moves through the apps.
The event is logged when the transaction hits the app, not when it leaves
In this case, you can only work out 2 durations if there's 3 apps, and the time between the events for app1 and app2 is the duration spent in app1
Adding totals is simple (or at least it is if your eventguid isn't numeric !)
Just add
| addtotals
or if your eventguids really are numeric
| eval eventguid=" ".eventguid | addtotals | eval eventguid=ltrim(eventguid)
... View more