Splunk Search

How to accum a field extra for each user?

p_splunk
Engager

Hi,

i want to accumulate a field per user (and time).

so lets say the users are distinguishable by the field user and the field i want to accumulate per user is XP.

if i do smth like

...| sort 0 +_time | stats c(user) as XPgains by user | accum XP as accumXP

I see in the list of logevents that the function accumulates over all users beginnining from first time event to the very last and the accum fct doesn't take any "by user" or smth like this.

how can I get a field which starts counting new for every user?

Tags (1)
0 Karma
1 Solution

Ayn
Legend

Use streamstats instead:

... | streamstats count by user AS accumXP

View solution in original post

Ayn
Legend

Use streamstats instead:

... | streamstats count by user AS accumXP
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...