Splunk Search

How to pick a values are in sequence using streamstats greater than 8 continuous value

DataOrg
Builder

If a streamstats sequence value is continuous to 1-10 values. i need to pick entire count of data . My search is | streamstats reset_on_change=true count(value_TS) AS Sequence BY incremented TS
for example: if sequence is equal to 4 or greater than 3. i need to pick all 4 values ie(1-4) or else skip
mockUp data
streamsstats
1
2
3
4
1
1
1
2
3

0 Karma
1 Solution

to4kawa
Ultra Champion
your_search
| streamstats reset_on_change=true count(value_TS) AS Sequence BY incremented TS
| reverse
| streamstats reset_after="Sequence=1" count(eval(Sequence>=4)) as flag
| reverse
| where flag > 0

Hi, @premranjithj
How about this?

View solution in original post

0 Karma

somesoni2
Revered Legend

Whats the expected output of your sample data?

0 Karma

to4kawa
Ultra Champion
your_search
| streamstats reset_on_change=true count(value_TS) AS Sequence BY incremented TS
| reverse
| streamstats reset_after="Sequence=1" count(eval(Sequence>=4)) as flag
| reverse
| where flag > 0

Hi, @premranjithj
How about this?

0 Karma

DataOrg
Builder

@to4kawa Super !!! thanks 🙂 worked

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this untested search:

...  | streamstats reset_on_change=true count(value_TS) AS Sequence BY incremented TS
| streamstats max(Sequence) as Max
| where Max > 3
| ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

DataOrg
Builder

the max value is following the change in sequence value too. i need only the first 4 values and if the sequence is followed in other sequence need to pick the fresh set of values

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...