Security

"Your session is invalid" message when using CLI

seren
Explorer

I've just upgraded to 4.2 and am having problems with command-line scripts that run splunk searches. When I run a search from the CLI, I'm prompted with:

"Your session is invalid.  Please login."

If I enter my username and password manually, it works for a while but prompts again after a period of time. This is causing my scripts to fail. Any ideas how to disable authentication from the command-line, or some other work-around? Thanks in advance.

0 Karma
1 Solution

LCM
Contributor

You have a timeout (configurable) on the UI, so as the CLI. Anyway - you either could try this one AuthToken or within your command-line script: splunk search '<search> -auth user:password - of course in that option the password is visible to anyone who can read your script, or when you do 'ps -ef'!

View solution in original post

LCM
Contributor

You have a timeout (configurable) on the UI, so as the CLI. Anyway - you either could try this one AuthToken or within your command-line script: splunk search '<search> -auth user:password - of course in that option the password is visible to anyone who can read your script, or when you do 'ps -ef'!

seren
Explorer

Thanks a lot. That was it.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...