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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...