Splunk Search

How to plot a graph based on values of a field?

dritjon
Path Finder

I have a search whish results in these events:

    

userlast_event
user12021-12-30 08:57:36.77
user22022-03-12 22:29:52.333
user 32022-03-13 08:02:48.253

 

I want to plot a chart where on the X axis there's the dates and on the Y there's the user

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try this

| eval _time=strptime(last_event,"%Y-%m-%d %H:%M:%S")
| timechart count by user

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You need three things to plot a graph, the x-axis field, the y-axis value and the series name - from your example, the x-axis would be the time (you should parse the string to an epoch time strptime()); the series name would be the user name(?), but what would be the y-axis value?

0 Karma

dritjon
Path Finder

the  y-axis value would always be 1 for example.

I just want a chart where I can see (in the last year for example) when's the last event of a users

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try this

| eval _time=strptime(last_event,"%Y-%m-%d %H:%M:%S")
| timechart count by user
0 Karma

dritjon
Path Finder

Thanks, it worked.

Just for visualization, any way I can make that chart as Bubble Chart?

 

Because as is it works only as a Column Chart

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Bubble charts don't display time very well

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...