Dashboards & Visualizations

Extract count of the last day for each month

marco_massari11
Communicator

Hi, 

I have a query 

index=network_appliance Hostname=* (sourcetype="old" OR sourcetype="new")  Interface=* field=......................

and I want to display in a column chart the count of Interfaces of the last day for each month. So the result should be something like this:

October        1000

November    1100

So 1000 and 1100  should be the count of interfaces of 31/October and  25/November (last day of the current month).

 

Thank you in advance! 

Labels (4)
0 Karma
1 Solution

to4kawa
Ultra Champion

try
| eventstats max(date_mday) as last_day by date_month
| eventstats count(eval(last_day=date_mday)) as lastday_count by date_month Interface

View solution in original post

to4kawa
Ultra Champion

try
| eventstats max(date_mday) as last_day by date_month
| eventstats count(eval(last_day=date_mday)) as lastday_count by date_month Interface

marco_massari11
Communicator

I think it's enough to remove Interface in the by and that's it!

0 Karma

marco_massari11
Communicator

@to4kawa  I think in the second line you means stats and not eventstats. Anyway with stats command I have the month, the interface name and the count for each interface. I don't need the interface name but the total Interfaces count.

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...