Dashboards & Visualizations

How to chart the 5 most recent events?

merdenoms
Loves-to-Learn Everything

How can I chart/graph out the 5 most recent events?

When an event occurs, the data/time is stored in whenCreated.  whenCreated has the format of 00:00.00 AM, Weekday DD/MM/YYYY.  Can I use this format?

I want to print the eventName and whenCreated.  But dedup eventName so that it only shows different values.

Here is my normal query:

 

index=main admonEventType=* | sort - whenCreated | dedup eventName | table eventName whenCreated | head 5

 

It looks like I can possibly do this with a statistics table using:

 

| chart values(*) by eventName

 

Could I put this in a bar chart?

 

Labels (2)
Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Times in string form will not sort as you might expect so they should be converted into epoch (integer) form before sorting.  Try this

index=main admonEventType=* 
| eval sortTime = strptime(whenCreated, "%H:%M.%S %p, %A %d/%m/%Y")
| sort - sortTime
| dedup eventName 
| table eventName whenCreated 
| head 5
---
If this reply helps you, Karma would be appreciated.
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 ...