Hi All,
I have written a python script which merely reads the file from the network drive. When I am running this python script manually, the script is running fine & python script is reading the data from the network drive. But when I am using this script as a scripted input (I have placed in script in : $SPLUNK_HOME$/bin/scripts & have updated inputs.conf in the "local" folder), the script throws the following error :
No such files or directory : 'G:\foo\bar\log file'.
Please note that I am running Splunk on Windows enterprise 2012 R2 server.
Can you please help in this regards?
Thanks and regards,
Arjit.
My first guess would be that your user account has permissions to view that drive, while the user Splunk is running as, doesn't? So check the folder permissions and/or test-run the script under the same account Splunk uses to get a more representative result.
Alternatively, looking at the error, there may be too many \
characters, but that doesn't explain why it does work when executed manually.
My first guess would be that your user account has permissions to view that drive, while the user Splunk is running as, doesn't? So check the folder permissions and/or test-run the script under the same account Splunk uses to get a more representative result.
Alternatively, looking at the error, there may be too many \
characters, but that doesn't explain why it does work when executed manually.
@FrankVI: Hi Frank! splunkd logs only refer to the above error message. It doesn't shows anything. There is another observation here. The os.environ parameters are different for my python program and the python installed within splunk. How can I make them both same?
Thanks for your help.
Kind regards,
Arjit.
I'm not an expert on python, so can't help you with that I'm afraid. Have you been able to find the user splunk runs as?
PS: please post comments as comments, not as new answers. I can convert them for you but it is a lot easier if you post them correctly right away 🙂
@FrankVl: Hi Frank ! ahh I got what you mean. Actually didn't see this. Sure will update in the comment section 🙂
Thanks for your help. What I did was I used the stdout from python (print command) to show the username and it was the hostname. I guess that's the reason why it is not able to access the network drives. Still figuring out alternate way to get this going.
Kind regards,
Arjit Goswami.
@FrankVl: Hi Frank! Thanks for your response. How can I check whether the Splunk has permission to access that folder?
I am able to access network drive using my credential but I am not sure which ID Splunk uses to access the network drive. I am logged in in Admin mode.
Can you help here?
Thanks and regards,
Arjit Goswami.
Assuming it is running as a service: check the properties of the splunkd service.