Hello,
I have created a Splunk app and it is currently in marketplace. I am getting a timeout error while pulling data from my API into Splunk app. Upon investigation, I figured out that I need to increase 'splunkdConnectionTimeout' from 30 sec to a higher value, in `$ SPLUNK_HOME /lib /python3.7 /site-packages /splunk /rest /__ init__. py’, line number 52.
I want to modify this as and when the user installs my app, this modification should be applied upon restarting the splunk.
I tried doing this by using `web. conf` file in my app but I am not sure where and how to use this.
Please help me how can I do this.
@priyanshuraj400 - I'm assuming you are using the `rest.simpleRequest` method.
In there, you can pass a parameter called timeout. For example
rest.simpleRequest(apiPath, sessionKey=mySessionKey, method='GET', timeout=None)
I hope this helps!!!
Hi @VatsalJagani,
Yes, that is what I want to set. If you look into `$ SPLUNK_HOME /lib /python3.7 /site-packages /splunk /rest /__ init__. py’, line number 52, you will find a parameter 'splunkdConnectionTimeout'
I believe if somehow I can set this parameter from outside, I will be able to increase the timeout.
Upon going through documentation, I found out 'web.conf' might be a way to do that.
https://docs.splunk.com/Documentation/Splunk/9.1.0/Admin/Webconf
in this documentation, you will find the 'splunkdConnectionTimeout' parameter.
But I am unable to figure out that how to use this config file through app. Basically I need to set this varibale timeout through my app only, there should be no external effort.
If there is any other way to do it, I am open to that also.
As I mentioned that timeout is for rest.simpleRequest() and not for the custom rest endpoint you might have in your App.
For setting that parameter for your custom Rest Handler, you can set it under web.conf under your Rest handler's stanza, you can add that parameter.
splunkdConnectionTimeout = 120
(For reference - https://community.splunk.com/t5/Splunk-Search/How-do-I-change-the-REST-API-execution-timeout/m-p/295...)
I hope this helps!!! Kindly upvote if it does!!!
I understand @VatsalJagani , but my question is, I have to set web.conf manually, right?
Is there any way that my app do that automatically?