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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...