A field: a=1,2,3,4..... disordered
i need a search like:
a=1
| append [search a=2]
| append [search a=3]
| append [search a=4]
....
where i can not simpley use "sort" ...
is there any syntax like "if a<n a++ and search something...." in splunk?
by the way, is there better way than " ...| head 88 | tail 1" when i want the 88th event?
thank you
[EDIT]
OK! this is what i am after:
Puting events in the right order, for example a business procedur
acc=crazyeva (1a)
id=0001 (1b)
tim=20121009 (1c)
act=toopooltopurch (1d)
but "_raw" data is disordered by "_time":
# _raw
16 11:48 acc=1a
15 11:49 id=1b
14 11:50 acc=2a
13 11:51 tim=1c
12 11:52 acc=3a
11 11:53 act=1d
10 11:54 id=2b
9 11:55 id=3b
8 11:56 tim=2c
7 11:57 acc=4a
6 11:58 tim=3c
5 11:59 act=2d
4 11:60 id=4b
3 11:61 act=3d
2 11:62 tim=4c
1 11:63 act=4d
....
The only rule is in the time line:
1b never comes before 1a, the same manner, 1a >> 1b >> 1c >>1d, 2a >> 2b....;
2a never comes before 1a, the same manner, 1a >> 2a >> 3a >>4a, 1b >> 2b....
this is my solution:
acc | sort _time | head 1 | tail 1
| append [search id | sort _time | head 1 | tail 1]
| append [search tim | sort _time | head 1 | tail 1]
| append [search act | sort _time | head 1 | tail 1]
| append [search acc | sort _time | head 2 | tail 1]
| append [search id | sort _time | head 2 | tail 1]
| append [search tim | sort _time | head 2 | tail 1]
| append [search act | sort _time | head 2 | tail 1]
| append [search acc | sort _time | head 3 | tail 1]
| append [search id | sort _time | head 3 | tail 1]
| append [search tim | sort _time | head 3 | tail 1]
| append [search act | sort _time | head 3 | tail 1]
| append [search acc | sort _time | head 4 | tail 1]
| append [search id | sort _time | head 4 | tail 1]
| append [search tim | sort _time | head 4 | tail 1]
| append [search act | sort _time | head 4 | tail 1]
.........
| streamstats count | eval _time=count | sort _time
| transaction maxspan=4s
two problem:
1.I need to do a "loop search" if there are too many events
2."transaction" command does not work on written "_time"
a second way:
* | sort _time | stats list(acc)
| appendcols [search * | sort _time | stats list(id) ]
| appendcols [search * | sort _time | stats list(tim) ]
| appendcols [search * | sort _time | stats list(act) ]
| table list(acc) list(id) list(tim) list(act)
the result seems like a table, but its not a useful table at all
Could you help me to put them in order?
... View more