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
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...