Hi leejaeyong,
you can try this:
| makeresults count=100
| streamstats count AS foo
| eval factor1_min=(random() % 100) /2, factor1_hierarchy_flag=(random() % 100) +2
| rename comment AS "This ^^^ just creates dummy data"
| eval factor1_prev=factor1_min+factor1_hierarchy_flag*(foo-1),
factor1_pv=factor1_min+factor1_hierarchy_flag*foo,
factor1_next=factor1_min+factor1_hierarchy_flag*(foo+1),
factor1_hierarchy=case(factor1_prev < factor1_pv AND factor1_pv <factor1_next, foo, factor1_pv>factor1_max, 0, true(), "unknonw")
Everything up until the rename command creates just dummy events, and the last eval will be your loop over the 100 events. In this example foo is your i in your code.
Hope this helps ...
cheers, MuS
PS: I noticed that in your example factor1_max is missing that's why the last case() statement never will match.
... View more