I installed the twilio app and configured it per its documentation, but it is throwing an error saying that it can not import the module twilio.rest when trying to run the python scripts to pull down data. As far as I can tell there is no clear way to add a python module to splunk. Do you have to configure it to use an external python installation, or am I missing something here?
It doesn't appear that this app would ever work out of the box, as it attempts to use the Twilio Python Module, which isn't included in the app, and not mentioned in the instructions.
You can attempt to install the Twilio Python Module from the link above, but because Splunk uses it's own Python executable, I'm not sure how well that will work. I tried dropping it into the bin/ directory of the app and while it resolved your error, It just hit another include it didn't know what to do with:
[Eric@Erics-MacBook-Air bin]$ splunk cmd python get_call_logs.py
Traceback (most recent call last):
File "get_call_logs.py", line 6, in <module>
from twilio.rest import TwilioRestClient
File "/Applications/Splunk/etc/apps/twilio-app/bin/twilio/__init__.py", line 4, in <module>
from six import u
ImportError: No module named six
You can go pull that module down and include it in the apps bin/ directory too, but that's getting a little ridiculous, and doesn't get the app working anyway. (After doing so, I got CertificateHostnameMismatch errors that can't be easily fixed)
Bottom line: Recommend contacting the developer of the app asking for a proper fix. The app as distributed seems unusable.
Hey Jacob - sorry about this. Eric is right (thanks for the attempted fix!). I hacked my Splunk to get this to work originally and didn't really think when shipping the app in haste.
I'm actually working on updating this app to include calls to the Twilio API, bypassing the need for Python scripts completely. Should be complete in a few weeks.
In the meantime, I've shipped a new version with updated docs to include a loose workaround that will work in some environments.
Any guidance on OS/Python versions? I tried to get this working on CentOS 6.5 with Python 2.6.6, and both the scripts were throwing errors. My Python's not really good enough to debug this.
this may help
http://twilio-python.readthedocs.org/en/latest/faq.html
None of that really applies when dealing with a Splunk app. Splunk bundles it's own Python interpreter, so it's not using the system Python, which all of those tips assume. One would expect any Splunk apps utilizing python to be entirely self-contained and run as expected out of the box without any additional Python environment configuration.
It doesn't appear that this app would ever work out of the box, as it attempts to use the Twilio Python Module, which isn't included in the app, and not mentioned in the instructions.
You can attempt to install the Twilio Python Module from the link above, but because Splunk uses it's own Python executable, I'm not sure how well that will work. I tried dropping it into the bin/ directory of the app and while it resolved your error, It just hit another include it didn't know what to do with:
[Eric@Erics-MacBook-Air bin]$ splunk cmd python get_call_logs.py
Traceback (most recent call last):
File "get_call_logs.py", line 6, in <module>
from twilio.rest import TwilioRestClient
File "/Applications/Splunk/etc/apps/twilio-app/bin/twilio/__init__.py", line 4, in <module>
from six import u
ImportError: No module named six
You can go pull that module down and include it in the apps bin/ directory too, but that's getting a little ridiculous, and doesn't get the app working anyway. (After doing so, I got CertificateHostnameMismatch errors that can't be easily fixed)
Bottom line: Recommend contacting the developer of the app asking for a proper fix. The app as distributed seems unusable.
Thanks for the answer. I actually got the CertificateHostnameMismatch error fixed by including httplib2 v0.8 in the bin directory of the app. That gets the scripts to actually run from command line, but still having some problems with it running correctly. In the end I decided to just scrap using the app and make my own.