Activity Feed
- Posted Re: Listing and plotting total and average events by hour on Splunk Search. 11-01-2022 05:26 PM
- Posted Re: Listing and plotting total and average events by hour on Splunk Search. 10-14-2022 10:30 AM
- Posted How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Tagged How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Tagged How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Tagged How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Tagged How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Tagged How to list and plot total and average events by hour? on Splunk Search. 10-13-2022 05:31 PM
- Karma Re: Search History disappeared ( Splunk Enterprise 8.0.1) for ivanreis. 07-07-2022 11:32 AM
- Karma Re: Hiding Apps for sdaniels. 07-07-2022 11:19 AM
- Karma Re: add icon to app for kamlesh_vaghela. 07-07-2022 11:18 AM
- Karma Re: How do I use a value in an existing field to create a new field and assign output values? for woodcock. 06-05-2020 12:49 AM
- Karma Re: How do I use a value in an existing field to create a new field and assign output values? for jkat54. 06-05-2020 12:49 AM
- Got Karma for Re: How do I use a value in an existing field to create a new field and assign output values?. 06-05-2020 12:49 AM
- Got Karma for Re: How do I use a value in an existing field to create a new field and assign output values?. 06-05-2020 12:49 AM
- Got Karma for Re: How do I use a value in an existing field to create a new field and assign output values?. 06-05-2020 12:49 AM
- Karma Re: How to group rows together in a table and calculate the sum for each group? for sundareshr. 06-05-2020 12:48 AM
- Karma Re: All results are not returned with multiple field exclusions for woodcock. 06-05-2020 12:48 AM
- Karma Re: How do I show stats where count is greater than 10, but without showing count field? for ppablo. 06-05-2020 12:47 AM
- Karma Re: Why is my search with "where NOT equals this OR this OR this" not filtering out results as expected? for Runals. 06-05-2020 12:47 AM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
0 | |||
0 | |||
0 |
11-01-2022
05:26 PM
Hi @gcusello , You put me on the right track! I modified what you provided to calculate the average: | eventstats count AS total by date_hour
| eval day=strftime(_time,"%m/%d/%Y")
| stats dc(day) AS days count BY date_hour
| eval average=round(count/days,2)
| sort by date_hour
| rename count as SumOfEvents, days as NumOfEvents I used the syntax below separately to calculate the number of days in my selected date range. So for the month of August, TotalDays will have a value of 31. | eventstats dc(date_mday) as daysNmonth
| timechart sum(daysNmonth)
| stats count(_time) as TotalDays I'm having trouble incorporating TotalDays with the first block of syntax to calculate: cumulative=round(SumOfEvents/TotalDays,2)
... View more
10-14-2022
10:30 AM
Ciao @gcusello , I've played around with the commands a bit, but still not getting the desired results. I may not have explained well in my initial post, but I'm trying to get event counts and averages for a specific time range. For example, if I have the following in my data: date 01 12 17 08-01-2022 1 08-02-2022 1 2 08-03-2022 1 7 08-04-2022 1 I'd like to calculate the averages as follows: standard avg = Σ events/# of events cumulative avg = Σ events/# of days date_hour Σ events # events # days standard avg cumulative avg 01 3 3 6 1 0.50 12 1 1 6 1 0.16667 17 9 2 6 4.5 1.5 The calculations would be executed separately so I can plot one line chart with Σ events vs standard avg and another with Σ events vs. cumulative avg. The table for standard average would look like this: date_hour Σ events # events standard avg 01 3 3 1 12 1 1 1 17 9 2 4.5 Thanks for the help!
... View more
10-13-2022
05:31 PM
I'm trying to do something pretty straightforward, and have looked at practically every "average" answer on Splunk Community, but no dice. I want to compare total and average webpage hits on a line chart. I calculated and confirmed the standard (fillnull value=0) and cumulative (fillnull value=null) averages with the following:
host.... | bin _time span=1h | eval date_hour=strftime(_time, "%H") | stats count as hits by date, date_hour | xyseries date, date_hour, hits | fillnull value=0 |appendpipe [| untable date, date_hour, hits | eventstats avg(hits) as avg_events by date_hour | eval "Average Events"= avg_events | xyseries date date_hour avg_events | head 1 | eval date="Average Events"]
How do I plot hits and avg_events on a line chart by date_hour? Also, if there is less convoluted SPL to get the same results, I'd love to know that as well—because I think I found where Google ends.
Thanks!
... View more
11-06-2017
03:33 PM
Oh... ok @niketnilay. I must have entered something wrong the first time, because no results were returning and it worked when I added the limit. I tried all three solutions today with success. Thanks again!
... View more
11-03-2017
02:43 PM
Hi @niketnilay. I knew top command was ideal, but I missed adding the by area portion in some attempts, and tried it in conjunction with stats count in others. The grouping portion of my question was just an alternative option for displaying the information, if anyone had ideas. There was a small typo in the solution you provided, but the following displayed exactly what I needed:
… |top limit=10 type by area
Thanks for the help!
... View more
11-03-2017
12:45 PM
Below is a sample from the end of my search:
...
|stats count by area, type
|sort -count
Using the Trellis layout, split on AREA, six pie charts counting by TYPE are returned. I’d like to display the Top 10 types for each area. If the top command can’t be used, how can I group anything over the first 10 results in an “other” pie segment?
... View more
08-10-2017
11:53 AM
1 Karma
@jkat54 and @woodcock this is my first real attempt a crowdsourcing and I like it! You guys have been awesome!
... View more
08-10-2017
11:37 AM
1 Karma
@jkat54, thanks for the suggestion. I decided to accept the answer with the higher EPS.
Adding each eval to the rest of my search against 10 months of logs in Verbose mode:
|eval type=case(match(title...) returned 14,190 EPS
and
|eval type=if(match(title...) returned 13,408 EPS
... View more
08-08-2017
11:24 AM
Once I capitalized summary and detail it worked. Now I know how to account for upper and lower too.
Thanks for the help!
... View more
08-08-2017
11:18 AM
1 Karma
I changed * to .* in the eval and it worked!
Thanks so much!
... View more
08-07-2017
05:39 PM
Thanks for responding so quickly!
This is creating the TYPE field, but it's only returning the value "unknown type". Could this have something to do with special characters in the titles?
... View more
08-07-2017
05:35 PM
Thanks for the quick response!
I tried this with * and with .* for wildcards, but I get the following error:
Error in 'eval' command: The arguments to the 'searchmatch' function are invalid.
... View more
08-07-2017
01:08 PM
I'm trying to create a new field called TYPE, which is dependent on the word "summary" or "detail" appearing in the TITLE field, so I can then count by TYPE.
I successfully filtered my logs to identify reports with "summary" or "detail" in the title:
|search(title="*summary*" OR "*detail*")
Then, I tried to create TYPE and set its output values to "Report Summary" or "Detailed Report":
|eval type=if(match(title,"*summary*"), "Report Summary", match(title, "*detail*"), "Detailed Report")
I also tried doing a field extraction, but the title field does not appear in the Select Fields box to be highlighted.
I'm stuck. Please help!
... View more