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!

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...