Splunk Dev

Python script for REST API call

pal_sumit1
Path Finder

Hi All,

I have a use case where I need to create an API connection and but the problem is we need to have an access token that we will supply in "HTTP Header Properties". This access token is created through another refresh token that can be done through putty or postman etc.. Now the main problem is, this access token is valid for only 10 mins and till 10 min we are getting the data in Splunk from that source. But after that time we need to again repeat the same process manually.

I need to automate this process by adding a python script. The python script will run every 10 min to generate access token from refresh token and that access token then be used to get the data from the source.

Thanks in advance.

Labels (2)
0 Karma

MuS
Legend

Hi pal_sumit1,

check out this app https://splunkbase.splunk.com/app/1546/ it supports refresh of the REST auth token.

Hope this helps ...

cheers, MuS

0 Karma

pal_sumit1
Path Finder

Hi,
I have checked that app, it is showing need to create python script for that

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...