Getting Data In

splunkd.exe environment variables SPLUNK_HOME PYTHONPATH etc

hvram
New Member

Hi
I installed Splunk on my laptop (Windows 7 64 bit) and things worked fine . I stopped the Windows service and was playing around with some Python modules

Now i am able to start Splunkd from the command line IF I set the environment variables SPLUNK_HOME, SPLUNK_DB,PYTHONHOME . But if I start as a service it does not work (i.e. net start splunkd )

How do I set the enviroment variables ?

Regards
Haro

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

It sounds as if you corrupted the Splunk install a bit. I'd uninstall / reinstall to have those variables restored. You can also start splunk like this:

cd C:
cd C:\Program Files\Splunk\bin
splunk.exe disable webserver
splunk.exe start

This should turn off the splunkweb, and then start Splunk correctly. Running splunkd.exe is not an option. If it still fails with a Python Error, add the Splunk Path back to the Environment Variable. http://www.itechtalk.com/thread3595.html

0 Karma

HiroshiSatoh
Champion

Are you sure you want to exist "site.py"? Or, do you not broken?
A similar message is displayed if you remove the "site.py" from "\LIB".

0 Karma

hvram
New Member

This is the error that I see in the logs

07-17-2013 15:12:23.681 +0530 ERROR loader - File "D:\Splunk\Python-2.7\Lib\site-packages\site.py", line 74, ..
07-17-2013 15:12:23.681 +0530 ERROR loader - raise ImportError("Couldn't find the real 'site' module")
07-17-2013 15:12:23.681 +0530 ERROR loader - ImportError: Couldn't find the real 'site' module

I can solve this problem by starting splunkd from the command line by setting SPLUNK_HOME, SPLUNKDB , PYTHONHOME and then start splunkd . The logs say that splunk has started

0 Karma

hvram
New Member

I understand that I should not be doing it . But as I mentioned :
I installed a couple of Python modules which caused changes to PYTHONPATH etc
So I have been trying to debug why it stopped and figured these .

0 Karma

Ayn
Legend

You're saying again though that you're running "splunkd from a command line" - you shouldn't be running splunkd directly at all, ever, because you need to run splunk which takes care of setting up the environment variables and a bunch of other things before invoking splunkd.

0 Karma

hvram
New Member

No I am trying to run splunkd as a service . If I run from command line I figured out that I need to set certain environment variables . I would like to set these variables and then run as a service . The reason i would like to do this is because I can run splunkd from a command line but I cannot run splunkweb

0 Karma

Ayn
Legend

Do you mean you're trying to run splunkd.exe instead of splunk.exe? Because splunkd.exe is not meant to be executed directly from the command line.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...