Splunk Dev

Python Extension Module To DB2 doesn't work

bansi
Path Finder

I am trying to add the DB2 database module (i.e ibm_db-1.0.3-py2.6-win32.egg) to Splunk Python on Windows 2008 Server 64 bit OS

I found a similar question here: http://answers.splunk.com/questions/8/can-i-add-python-modules-to-the-splunk-environment

http://answers.splunk.com/questions/6033/adding-python-module-to-splunk

When I did the steps mentioned in the posting, it doesn't extract anything. So please let me kno where i am going wrong.

Here are the steps

  1. Copy the ibm_db-1.0.3-py2.6-win32.egg file to c:\Splunk\bin
  2. Extract Python Module using below command didn't do anything:

    cd c:\splunk\bin

    splunk cmd python setup.py install

Opens up a new command prompt window and immediately closes it. I am sure it didnt do anything as i didnt find aynthing extracted in the folder

C:\Splunk\Python-2.6\Lib\site-packages

I also tried copying setup.py to c:Splunk\bin but it didnt help.

Then i tried the following command which didnt work either

$ splunk cmd ./ibm_db-1.0.3-py2.6-win32.egg 

So i am not sure if their is an easy way to add python module to Splunk. Please note i am using Python version of Splunk i.e. 2.6

Tags (2)

araitz
Splunk Employee
Splunk Employee

stefano_guidoba
Communicator

Bansi how you made your lookup script running in Splunk? Im going mad..

0 Karma

bansi
Path Finder

Ok i have installed pyodbc module on system python 2.7 and have external database lookup script running under system Python 2.7.

Please let me know how to integrate the database lookup script into Splunk Python version 2.6.

0 Karma

jrodman
Splunk Employee
Splunk Employee

executing an egg directly as jonvey's example isn't going to work on windows.

I'm not a big fan of eggs as they're supposed to make things easier, but they make things harder if you don't know how they work. There's this general egg-install-on-windows thing http://stackoverflow.com/questions/458311/how-do-i-install-an-egg-file-without-easy-install-in-windo...

Do we really ask people to install python modules in our environment? It's generally a more stable result to install modules in a system python that won't get updated on splunk upgrade.

0 Karma

bansi
Path Finder

Well as i mentioned in original post, i did saw the article you are referring to but it doesn't help in my case. I guess the problem in my case is 1)NO Python DB2 module is available for 64 bit OS OR 2) i am missing how to extract ibm_db-1.0.3-py2.6-win32.egg file to c:\Splunk\bin. Please note following commands doesn't work for me.
1)splunk cmd python setup.py install
2) splunk cmd ./ibm_db-1.0.3-py2.6-win32.egg
What am i missing?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...