All Apps and Add-ons

timechart of raw event count against per-user count

awurster
Contributor

hi folks -

i'm trying to plot a timechart with two separate values:

1 - the raw event count (a.k.a total number of "transactions") over time
2 - the value of said raw event count over time, divided by the number of unique / distinct users

i'd also like to try and get a 3rd single value which represents the average number of transactions for any given day across the whole deployment. i imagine that'd be a saved search based on the search above, which i can summarise.

the deployment consists of several cisco WSAs submitting their access log data.

** note that "users" who do not authenticate show up as user_id="-" however i've used eval to substitute the device IP (dvc_ip) wherever that hyphen occurs, for cleaner data.

eval user_id=if(user_id=="-",dvc_ip,user_id)

cheers,

andrew

0 Karma

kristian_kolb
Ultra Champion

Perhaps this can give you some insights regarding the use of timechart, eventstats, eval and addtotals. It's based on _internal data, so you can run it for yourself.

index=_internal sourcetype=splunkd earliest=-5d@d latest=@d
| timechart span=1d c by group limit=0 useother=f 
| addtotals fieldname=Daily_Total 
| eventstats avg(Daily_Total) AS Total_Avg  
| eval Total_Avg=round(Total_Avg,1) 
| eval Total_Diff = Daily_Total - Total_Avg

Hope this helps,

K

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...