Splunk Search

What this query will do?

harshal94
Engager

streamstats current=f latest(up) as oldUP by lowername
I am bit confused what will streamstats calculate here?

Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi @harshal94,

In this search streamstats calculating latest value of up field by lowername. Here you will get oldUP as new filed. Here you set current=false & If current=false, the search uses the field value from the previous event.

Please check below doc for more information.

http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Streamstats

0 Karma

cmerriman
Super Champion

streamstats basically grabs all of the previous events within the set parameters. you are not setting a window to only grab the previous event, or previous 10 events (window=10), so it'll search all previous events. current=f will exclude the current event. it does this for every event in your dataset. so your search will grab the latest seen up value from every event before the current event and add a field called oldUP to the current event, by lowername.
something like this:

up  lowername   oldUP
foo1    bar1    
foo2    bar1    foo1
foo3    bar1    foo2
foo4    bar1    foo3
foo5    bar1    foo4
foo6    bar1    foo5
foo7    bar2    
foo8    bar2    foo7
foo1    bar2    foo8
foo2    bar2    foo1

http://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/Streamstats

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...