All Apps and Add-ons

Mark all days from Start_date to End_date as vacation in calendar visualization

rpradeep
Path Finder

I have input data in below format:
Emp_Name#Start_date#End_date#Vacation_type
emp123#11-Mar-2019#21-Mar-2019#Vacation

Currently, I am able to mark only the Start_date as vacation in my calendar visualization using below query:
| eval _time=strptime(Start_date,"%d-%b-%Y")
| timechart span=1d count by Emp_Name

Please help on how to mark all the days from Start_date to End_date in my calendar.

0 Karma

nickhills
Ultra Champion

Ah, In that case.. try this:

 | gentimes start=03/01/2019 end=03/25/2019 
 | eval _time=starttime 
 | eval Emp_Name="rpradeep", Start_date="2-mar-2019", End_date="8-mar-2019" 

 | eval start=strptime(Start_date,"%d-%b-%Y"), end=strptime(End_date,"%d-%b-%Y") 
 | eval vacation=if((_time>=start AND _time<=end),"yes","no")
 | where vacation="yes"
 | timechart count by Emp_Name

The first 3 lines, just generate some fake data, the last 4 lines should drop into your search

alt text

If my comment helps, please give it a thumbs up!
0 Karma

AnilPujar
Path Finder

@nickhillscpl
consider our outlook meeting calendar look.

There will be meeting start time and end time

In Month view I'll be able to show start time and end time which is managebale, But when you switch to week/day view.. the start time and end time capture will be not accurate. since _time will have only start time. When the meeting will end time will not be proper.

0 Karma

nickhills
Ultra Champion

Your source data does not have "times" in it - if you want to add this you could add a standard 09:00 - 17:00 working day to the value?

If my comment helps, please give it a thumbs up!
0 Karma

nickhills
Ultra Champion

I assume you are using the timeline visualization?

This search works in my testing:

| makeresults 1 
| eval Emp_Name="rpradeep", Start_date="1-jan-2019", End_date="8-Jan-2019"

| eval _time=strptime(Start_date,"%d-%b-%Y"), end=strptime(End_date,"%d-%b-%Y")  
| eval duration=round(((end-_time)*1000),0) 
| table _time Emp_Name duration
If my comment helps, please give it a thumbs up!
0 Karma

AnilPujar
Path Finder

does this work for calendar custom visualization,

as calendar viz expect timechart command..

0 Karma

AnilPujar
Path Finder

Even i'm looking for answer for same question..

The current version of app doesn't support for start and end datetime, only can mark on spot. The app is having really good viz in splunk for calendar look.

If they update for start and end date color mapping then jakkaas awesome..

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...