Hi
I am using Hunk and I am looking for a way to get transaction (grouping events by userid with start transaction and stop transaction event).
For example, I have events something like this:
2014/05/01 00:00:01 userid=u01 action=start
2014/05/01 00:00:02 userid=u02 action=start
2014/05/01 00:00:03 userid=u01 action=stop
2014/05/01 00:00:04 userid=u03 action=start
2014/05/01 00:00:05 userid=u03 action=stop
2014/05/01 00:00:06 userid=u01 action=start
2014/05/01 00:00:07 userid=u01 action=stop
2014/05/01 00:00:08 userid=u02 action=stop
Search result with transaction command is :
index=main sourcetype=transtest
| transaction userid startswith=action=start endswith=action=stop
| table _time userid duration'
_time userid duration
--------------------------- ------ --------
2014-05-01 00:00:06.000 JST u01 1
2014-05-01 00:00:04.000 JST u03 1
2014-05-01 00:00:02.000 JST u02 6
2014-05-01 00:00:01.000 JST u01 2
My try without transaction command is like this :
index=main sourcetype=transtest
| stats min(_time) as _time max(_time) as max by userid
| eval duration = max - _time
| table _time userid duration
_time userid duration
--------------------------- ------ --------
2014-05-01 00:00:01.000 JST u01 6
2014-05-01 00:00:02.000 JST u02 6
2014-05-01 00:00:04.000 JST u03 1
I want to get the result I get from transaction command, but I can not use transaction command because of the limitation of Hunk.
Is there any way to get transaction information without using transaction command?
Any commend would be appreciated.