Splunk Search

Why is msvcr80.dll, not msvcr90.dll been including in Splunk 5?

lzhang_soliton
Path Finder

According to the Release Note, version of Python in Splunk 5 is 2.7.3.

Reference: http://docs.splunk.com/Documentation/Splunk/5.0.2/ReleaseNotes/Python

But in Python 2.7.3 downloaded from python.org, msvcr90.dll has been included, not msvcr80.dll.

I have tried to use third-part library "pyodbc for Python 2.7" to access MS SQL Server, the library works in Python 2.7.3. In Splunk 5, it does not work since it depends on msvcr90.dll.

I still have no idea to use pyodbc in Splunk 5. Can someone help me?

0 Karma
1 Solution

lzhang_soliton
Path Finder

I have solved the problem by rebuilding pyodbc.pyd library.

Required items:

  • Visual Studio 2005

includes the compiler using msvcr80.dll.

  • Python 2.7.3 source code

includes Python command.

  • pyodbc source code

includes build option in setup.py.

Building pyd file:

Running python.exe in Python 2.7.3\PC\VS8.0 folder to build setup.py.

Check library dependencies:

Running Dependency Walker tool.

View solution in original post

lzhang_soliton
Path Finder

I have solved the problem by rebuilding pyodbc.pyd library.

Required items:

  • Visual Studio 2005

includes the compiler using msvcr80.dll.

  • Python 2.7.3 source code

includes Python command.

  • pyodbc source code

includes build option in setup.py.

Building pyd file:

Running python.exe in Python 2.7.3\PC\VS8.0 folder to build setup.py.

Check library dependencies:

Running Dependency Walker tool.

lzhang_soliton
Path Finder

Drainy, you are correct. I should not replace any files within Splunk.

Pyodbc is the third-party library that is not available in Splunk. So I rebuilt it to let it depend on msvcr80.dll using in Splunk. And I copied it to bin directory in my App. It will not be overwritten during Splunk upgrade.

0 Karma

Drainy
Champion

If you are replacing any files within Splunk just be wary that you will need to replace these any time you upgrade Splunk - it will overwrite them each time otherwise.

0 Karma

Drainy
Champion

Although Splunk updates the version of Python that ships with Splunk, as I understand it is still a custom build for Splunk and as such some libraries may not be updated or supported (I had some issues a year or so ago with a missing library).

For MS SQL connectivity, depending on what you want to do, you may find this app helpful;
http://splunk-base.splunk.com/apps/50803/splunk-db-connect

0 Karma

lzhang_soliton
Path Finder

Thank you, Drainy. I am really new to Python.
I have found the way to solve the problem.

0 Karma
Get Updates on the Splunk Community!

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

🍂 Fall into November with a fresh lineup of Community Office Hours, Tech Talks, and Webinars we’ve ...

Transform your security operations with Splunk Enterprise Security

Hi Splunk Community, Splunk Platform has set a great foundation for your security operations. With the ...

Splunk Admins and App Developers | Earn a $35 gift card!

Splunk, in collaboration with ESG (Enterprise Strategy Group) by TechTarget, is excited to announce a ...