Splunk Search

Average pageviews per hour

rcovert
Path Finder

I am trying to do something very simple but cannot figure it out. I am new to splunk and using the web intelligence app.

I am trying to look at the average # of pageviews for each hour of the day over a wide time period to find out the least busiest time of day so I can schedule maintenance.

Can anyone help me?

Tags (3)
0 Karma

meishar
New Member

Hi,

Try this:
sourcetype="that has data for pageviews" |chart avg(pageviews) over date_hour

Hope I helped:)


If you ever want to see breakdown by day run:

sourcetype="that has data for pageviews" | convert timeformat="%m/%d/%y" ctime(_time) as "day_time" | chart avg(pageviews) over date_hour by day_time

0 Karma

rcovert
Path Finder

That worked great for the total pageviews! Thanks! Here is the search:

host=* [ stats count | addinfo | eval range=info_max_time - info_min_time | eval search=if(range<=(86400+3600),"index=wi_summary_hourly","index=wi_summary_daily") ] source="User session visitor source*" | chart eval(sum(myeventcount)) AS pageviews over date_hour

However, I was looking for the average and when I replace sum(myeventcount) with avg(myeventcount), it doesn't give a correct average. Any thoughts?

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...