Dashboards & Visualizations

Create line chart of search duration in timeline

mngeow
Engager

Hi,

I have some vpn logs which show the vpn login activity per user, primarily the times that they disconnected, the duration of the session and the reason for the disconnection. I want the chart the duration of each session over a month by have a line chart with one line showing each duration, and also for the lines to be colour coded according to the reason of the disconnection.

The graph I am trying to achieve is shown in the link below:

https://wiki.splunk.com/Community:Search_Report:_How_To_Create_a_Line_Chart_of_Search_Duration_in_Ti...

The only difference is that I want the y-axis to be the day of the month, and the x axis to be the hour of the day.

I've tried working on it for several days and this is my current query:

earliest=-30d index=xxx sourcetype=xx Username=xx
| table reason _time duration
| eval startime=_time - duration
| eval BeginSession=strftime(startime,"%Y-%m-%d %H:%M:%S")
| eval EndSession=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table reason *Session
| eval combinedt=BeginSession.",",EndSession
| makemv delim="," combinedt
| mvexpand combinedt
| eval _time=combinedt
| rename combinedt as Time

This gives me a time series of consecutive connection and disconnection timings, but I am pretty much stuck at this point. Any help would be greatly appreciated.

Thanks!

0 Karma

somesoni2
Revered Legend

Give this a try

earliest=-30d index=xxx sourcetype=xx Username=xx
 | table reason _time duration
 | eval startime=_time - duration
 | table reason *Session
 | eval combinedt=startime.","._time
 | makemv delim="," combinedt
 | mvexpand combinedt
 | eval _time=combinedt
 | timechart useother=f span=1s first(duration) by reason
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...