Security

Why am I getting an authentication error trying to add oneshot via CLI from a remote computer?

Javo222
Path Finder

Trying to run a batch file to add a log file to splunk. Works fine if I run it locally but not from a remote computer.

This is the line I'm having trouble with:

\\172.25.30.30\Splunk\bin\splunk.exe" add oneshot "\\172.25.30.30\shared\splunk\reports\name\Server.log"

I tried to add:

-hostname localhost.localdomain

or:

  -auth admin:pass

But I still get the same error:

In handler 'oneshotinput': unable to open file: path='\\172.25.30.30\shared\splunk\reports\name\Server.log' error='Logon failure: unknown user name or bad password.'

admin and pass are the correct credentials to Splunk.
Anything I am missing?

0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi Javo222,

I just learned that the add oneshot is run locally on the Splunk instance you're running it. This means this should be listed in the docs as well as not supported remote command.

@piebob and @ppablo_splunk could you please verify this and have the docs updated? Thanks 🙂

cheers, MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi Javo222,

I just learned that the add oneshot is run locally on the Splunk instance you're running it. This means this should be listed in the docs as well as not supported remote command.

@piebob and @ppablo_splunk could you please verify this and have the docs updated? Thanks 🙂

cheers, MuS

piebob
Splunk Employee
Splunk Employee

just passed this on to our world class docteam! thank you, oh mighty SPAMHAMMER @MuS !

Javo222
Path Finder

ahah at least now I know why it didn't work! thanks guys!

ChrisG
Splunk Employee
Splunk Employee

Docs are updated to mention this restriction!

musskopf
Builder

Have you tried to use the default: "admin:changeme"?

0 Karma

MuS
SplunkTrust
SplunkTrust

normally you should uses the -uri https://splunkserver:8089 option if you want to use a remote cli command. See docs http://docs.splunk.com/Documentation/Splunk/6.2.2/Admin/AccessandusetheCLIonaremoteserver also did you enable remote access in server.conf on the remote server?

0 Karma

Javo222
Path Finder

I enabled remote access and changed to:

"C:\Program Files\Splunk\bin\splunk.exe" add oneshot "C:\Users\myuser\Documents\splunk_data\reports\name\Server.log" -uri http://172.25.30.30:8000

and I get "Not found" but I can't figure out what is not found. The path the the files is correct and tried to use remote path as well but no luck.

0 Karma

MuS
SplunkTrust
SplunkTrust

I'll check that tomorrow morning ....

0 Karma

Javo222
Path Finder

I found another way to do it. copied the files to the remote server and use monitoring the folder. So I don't need the oneshot add anymore.

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...