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!

Testing out the OpenTelemetry Collector With raw Data

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

New Cloud Intrusion Detection System Add-on for Splunk

In July 2022 Splunk released the Cloud IDS add-on which expanded Splunk capabilities in security and data ...

Happy CX Day to our Community Superheroes!

Happy 10th Birthday CX Day!What is CX Day? It’s a global celebration recognizing innovation and success in the ...