Splunk Dev

Python script Requirement : Holiday list updation

rijinc
Explorer

I have a regional level holiday list and source is a raw ITSM tools data where there is reported date and resolved date

For ex : CSV file for holiday list
App Location Des Date
App1 Pune Newyear 01/01/2020
App2 Singapore xxxxx 13/01/2020
App3 Pune/Singapore someday 14/01/2020

What my python code should check for the location and App in the raw data and also the location and app in holiday list and based on that it should trigger if there is a holiday or not

challenge : app3 has a holiday at both location at such case how to handle this

I tired something initially like this:
bt its throwing output as 'N' even when the holiday date and reported date matches

for holiday in holidays:
day , month , year= holiday.split('/')
holidate = date(int(year) , int(month) , int(day))
logger.info('%s', holidate)
if holidate == each_date.date():
is_it_holiday = 'Y'
else:
is_it_holiday = 'N'
result['is_it_holiday'] = is_it_holiday
break

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...