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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...