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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...