All Apps and Add-ons

Scripted input and perl DBD::Oracle

yahooku
Explorer

Hi all,
I'm using numerous perl scripts as data inputs - mostly for reading logs from different databases. I've recently tried to set up another input for Oracle database. For this I've installed perl DBD::Oracle driver. Everything works fine when I run the script from the console (using the same user which is running splunk process). The problem is the script won't work when it's run by splunk scheduler (just as every scripted input is). I've checked with index="_internal" logs and this is what I'm getting:

ERROR ExecProcessor - message from "/opt/splunk/etc/system/bin/get_AZP.pl" Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.

I've exported export ORACLE_HOME, PATH and LD_LIBRARY_PATH. I've also added appropriate .conf file in /etc/ld.so.conf.d/. What am I missing?

0 Karma
1 Solution

yahooku
Explorer

Eureka! It started working! I've palced the following bash script in /etc/profiles.d/

#!/bin/sh
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

I've tried this before but I set up wrong file privileges - they should be set on '644'. And dont forget to reboot the system.

View solution in original post

0 Karma

yahooku
Explorer

Eureka! It started working! I've palced the following bash script in /etc/profiles.d/

#!/bin/sh
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

I've tried this before but I set up wrong file privileges - they should be set on '644'. And dont forget to reboot the system.

0 Karma

takeda
Engager

Hi,

  • Did you execute 'ldconfig' after you added .conf to /etc/ld.so.conf.d/ ?
  • Make sure you installed 64bit version of Oracle client libraries.
  • Make sure LD_LIBRARY_PATH is exported in the shell script you run as scripted input.

yahooku
Explorer

Hi, thx for the suggestions:
1. Check
2. Check
3. Unfortunalety setting LD_LIBRARY_PATH inside the script will only affect external programs run by the script, it won't link perl itself with the libraries in that directory. The libraries are linked befoer the script itself runs.

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!

Introducing ITSI 5.0: Unified Visibility and Actionable Insights

Introducing ITSI 5.0: Unified Visibility and Actionable Insights Tuesday, July 21, 2026  |  10:00AM PT / ...

Inside Splunk Agent Observability: Understanding Agent Behavior, Tokens & Costs

Inside Splunk Agent Observability:Understanding Agent Behavior, Tokens & Costs Thursday, August 06, ...

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...