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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

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 ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...