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!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...