All Apps and Add-ons

Splunk Add-on Builder Custom Python Code: Issues setting initial checkpoint

Blake_D
Engager

Greetings,

I am writing a REST API call ingestion that requires authentication via first obtaining an auth token before the actual input, so I'm making use of the custom python code data ingestion builder for the first time.  Having issues with the initial setting of a checkpoint for the start date of the api call specifically.  I figure I need to check to see if the checkpoint exists, and if it doesn't - set the check point to the provided date from within the Data Input settings.  

When I try this with the below code snippet, I just get an error from the first line:

AttributeError: 'NoneType' object has no attribute 'encode'

ERROR 'NoneType' object has no attribute 'encode'

 

Not sure if there is a better way to set the initial check point somewhere that I'm not finding (this is in the collect_events function definition - so probably), or if there is a better way within python to handle the "if this doesn't exist, do this thing"

 

 

    start_date = helper.get_check_point(input_name)
    
    if start_date is None:
        helper.save_check_point(input_name, helper.get_arg("data_ingestion_start_date"))
        start_date = helper.get_check_point(input_name) 
        
    else:
        start_date = helper.get_check_point(input_name) 

 

  

Labels (1)
0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

Make sure the field `input_name` field is defined and it has the right string value.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...