Splunk Search

Can you help me to create a query with a timechart?

kingwaras
Engager

Hi all,

with the query below I have extracted the sum of overtime per day.

index="effort_tracker"
 | stats count by Day Hours Username
 | sort count 
 | stats sum(Hours) as Time by Day Username
 | where Time > 8
 | eval Overtime = Time-8
 | stats sum(Overtime) as Overtime By Day
 | sort -Day

Day ; Overtime
17/12/2018 ; 1
16/12/2018 ; 2
15/12/2018 ; 3

I need to create a timechart (Single Value chart) in order to view the difference between two dates provided by filters (the date formar is "%Y-%m-%d".

I hope I have explained my problem well.
Thanks in advance.

0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@kingwaras

Can you please try this?

YOUR_SEARCH | table Day Overtime | eval _time=strptime(Day,"%d/%m/%Y") | timechart values(Overtime) as Overtime

Thanks

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@kingwaras

Can you please try this?

YOUR_SEARCH | table Day Overtime | eval _time=strptime(Day,"%d/%m/%Y") | timechart values(Overtime) as Overtime

Thanks

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...