Splunk Search

How to edit my timechart search to display time on the x-axis and duration on the y-axis?

HCadmins
Communicator
eventtype=cv "Source Client"=* "Destination Client"=slc-p-res* OR dab* Duration=* | convert ctime(_time) | convert dur2sec(Duration) AS Durationsec | eval Durationhrs=round(Durationsec/60/60,2) | fields - "Destination Client" | table _time Durationhrs 

Returns a beautiful table with time and duration in hours.

I want to have a line chart that shows time as the X axis, and duration as the Y axis, however

eventtype=cv "Source Client"=* "Destination Client"=slc-p-res* OR dab* Duration=* | convert ctime(_time) | convert dur2sec(Duration) AS Durationsec | eval Durationhrs=round(Durationsec/60/60,2) | fields - "Destination Client" | timechart span=1d sum(Durationhrs)

Returns only the time stamp, and the Duration column is empty.

What am I doing wrong?

0 Karma
1 Solution

niketn
Legend

Take out convert ctime(_time) from your search

Timechart expects the time field in epoch format not ASCII.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

Take out convert ctime(_time) from your search

Timechart expects the time field in epoch format not ASCII.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...