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!

Splunk Enterprise Security 8.0.2 Availability: On cloud and On-premise!

A few months ago, we released Splunk Enterprise Security 8.0 for our cloud customers. Today, we are excited to ...

Logs to Metrics

Logs and Metrics Logs are generally unstructured text or structured events emitted by applications and written ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...