Getting Data In

Why is perl script not working in Splunk 6.2 and getting error 'Cannot login to: https://127.0.0.1:8834/'"?

pedromvieira
Communicator

Hi.

I'm using Splunk 6.2 with a scripted input.
My script works fine from shell.

Shell:

root@ubuntu:/opt/splunk/etc/apps/FOLDER/bin# ./SCRIPT.pl
Logged in
Export completed! /opt/.../reports/
Move completed! /opt/
Delete completed! /opt/.../reports/*.x
root@ubuntu:/opt/splunk/etc/apps/FOLDER/bin#

Script Example:

#!/usr/bin/perl
$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;

use strict;
use warnings;
use Net::Nessus::XMLRPC;

When I search for the error:

11-10-2014 15:37:20.382 -0200 ERROR ExecProcessor - message from "/opt/splunk/etc/apps/FOLDER/bin/SCRIPT.pl" Cannot login to: https://127.0.0.1:8834/

This message is defined inside the script, so it is working.

Tags (4)
0 Karma
1 Solution

pedromvieira
Communicator

I had to link perl library. Now it works.

#!/bin/sh
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
export LD_LIBRARY_PATH=/usr/local/share/perl/5.18.2/
perl $SPLUNK_HOME/etc/apps/FOLDER/bin/SCRIPT.pl

View solution in original post

0 Karma

pedromvieira
Communicator

I had to link perl library. Now it works.

#!/bin/sh
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
export LD_LIBRARY_PATH=/usr/local/share/perl/5.18.2/
perl $SPLUNK_HOME/etc/apps/FOLDER/bin/SCRIPT.pl
0 Karma

pedromvieira
Communicator
root@ubuntu:/opt# /opt/splunk/bin/splunk cmd /opt/splunk/etc/apps/FOLDER/bin/SCRIPT.pl
Cannot login to: https://127.0.0.1:8834/
root@ubuntu:/opt#

The same occurs with splunk cmd.

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 ...