Installation

How to use CLI

thomashigginson
Path Finder

How can I access the CLI for Splunk. I have tried for nearly an hour now with no success. The guides are helpful but evidently not nearly enough. Any help is appreciated!

Tags (1)

yannK
Splunk Employee
Splunk Employee

usually open a cmd.
go to cd C:\Program Files\Splunk\bin
and run splunk help

Remarks :

  • if you see linux commands, with .\splunk you can drop the .\
  • but if you switch to powershell, you need them

thomashigginson
Path Finder

I have fixed the problem by uninstalling splunk and reinstalling. Never figured out what happened, however.

0 Karma

thomashigginson
Path Finder

I am trying to use it on two different versions of Windows: 7 and 2008 R2 Servers. This is what shows on my splunk-launch.conf along with the other info.
Version 6.1.1
SPLUNK_HOME=C:\splunk\build-home\6.1.0

SPLUNK_DB=C:\splunk\build-home\6.1.0\var\lib\splunk

And I tried to catch the output and it gave me a blank txt file. The WinLog gets the output as the all the standard information and text that shows up on the Splunk CLI, and it says no error, but it closes immediately after opening. I have full administrative powers. Any ideas? I get the same problem when I try on both separatly

0 Karma

yannK
Splunk Employee
Splunk Employee

Very strange,

  • what is your version of windows ?
  • do you have custom system paths for %SPLUNK_HOME% , check the ..\etc\splunk-launch.conf and the windows paths.

To catch the output, you can redirect it to a text file.

splunk cmd btool inputs list > output.txt
notepad output.txt

0 Karma

thomashigginson
Path Finder

I just tried opening CMD as an admin and executing splunk, as well as going to the bin and running splunk as an admin. Both times I had the same result: Splunk CLI opens for a split second and then closes. I'm checking the WinLog events and it gives me Audit Success and No errors when I run it as an Admin-->so that is good. But, however, that doesn't explain why Splunk CLI keeps shutting down on me. Any ideas?

0 Karma

yannK
Splunk Employee
Splunk Employee

You have to decide what you want to do with the CLI ?
The list of commands is here:
http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/CLIadmincommands

And if when you run the command, the output pops up in a new window that disappears immediately, this is because you are not running the CMD as administrator.
Please restart your CMD window as administrator (it requires a right click on windows)

see http://lmgtfy.com/?q=run+CMD+as+administrator

0 Karma

thomashigginson
Path Finder

So, I've narrowed my issue down to "Not enough arguments, please specify a valid command from this list" and then Splunk CLI shutting down. Still, any ideas?

0 Karma

thomashigginson
Path Finder

When I try to use cmd, to open it, if I don't use an _ then cmd returns C:\Program is not an executable command. If I do use the _ , it returns that the it could not find the path specified. Okay, now, since I know where it is located, I just went to the folder to open it, but it opens the Splunk CLI and then it closes automatically after about half a second. Any ideas?

0 Karma

thomashigginson
Path Finder

Whenever I enter the path name in cmd, it can't find it. I have checked the file path multiple times to make sure it's correct. C:\Program_Files\Splunk\bin\splunk
and I have tried every variation of that. The backslashes in between.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...