Splunk Search

Bucketing by day for a table of result with eventstats

akhanVG
Path Finder

We've got summary index working great, but we need to back fill in some data from before we started the automated reports that populate the summary index.

Currently we measure conversion rate via this search:

index="ecom" eventName | eventstats dc(sessionId) as totalnumberofsessions | search eventName = orderPlaced | stats dc(sessionId) as numbuyers max(totalnumberofsessions) as total | eval ConvRate = round(numbuyers*100/total,2) | table ConvRate | addinfo | rename info_min_time as _time | table _time ConvRate

In our summary index it's set to -1@d, @d. I'm trying to now generate this data on a month by month basis PER day. I tried the following below, but it buckets all the data to the earliest / 1st day of the month

index="ecom" eventName | bucket _time span=1d | eventstats dc(sessionId) as totalnumberofsessions | search eventName = orderPlaced | stats dc(sessionId) as numbuyers max(totalnumberofsessions) as total | eval ConvRate = round(numbuyers*100/total,2) | table ConvRate | addinfo | rename info_min_time as _time | table _time ConvRate

We want it so that it gives the ConvRate for each day based on total # of sessions / sessions that have an eventName called orderPlaced.

Update - I think I solved it?
I think I figured this out - but if someone could confirm it's the right solution or tell me if there is a better way that'd be great.

index="ecom" eventName | bucket _time span=1d | eventstats dc(sessionId) as totalnumberofsessions by _time | search eventName = orderPlaced | stats dc(sessionId) as numbuyers max(totalnumberofsessions) as total by _time | eval ConvRate = round(numbuyers*100/total,2) | table ConvRate _time
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Splunk comes with a backfill script for summary indexes - see the docs at http://docs.splunk.com/Documentation/Splunk/6.3.0/Knowledge/Managesummaryindexgapsandoverlaps

0 Karma

akhanVG
Path Finder

Doh! Thanks. Here I've been manually doing it using | addinfo | collect.

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...