Getting Data In

Why am I getting a "/root/.splunk": Permission Denied error when running './splunk add forward-server ip:9997

Sudarshankumawa
Engager

Sudarshankumawa_0-1691505078527.png

While Forwarding Linux logs to Splunk I'm getting the error shown in the picture. Let me know if someone can me. I've setup Splunk Enterprise on ubuntu VM.

Labels (3)
0 Karma
1 Solution

VatsalJagani
SplunkTrust
SplunkTrust

@Sudarshankumawa - I see you are assigning the owner as vboxuser for Splunk but then running add forward-server command with root user.

I would use the user which is running Splunk for everything (running command, ownership of splunkforwarder should also be with that user).

 

I hope this helps!!!

View solution in original post

VatsalJagani
SplunkTrust
SplunkTrust

@Sudarshankumawa - I see you are assigning the owner as vboxuser for Splunk but then running add forward-server command with root user.

I would use the user which is running Splunk for everything (running command, ownership of splunkforwarder should also be with that user).

 

I hope this helps!!!

Sudarshankumawa
Engager

Hi Vatsal,
Thank you a million times over for your response. Can you provide me with any commands that are compatible with your approach and will address this issue?

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@Sudarshankumawa 

  • Stop Splunk first.
    • You will find which user is running Splunk right now with below command:
      • ps -aux | grep splunkd
  • Change ownership of files:
    • Run command with root user
      • chown -R <XYZ> /opt/splunkforwarder
    • Assuming you want to run splunk service with <XYZ> user.
  • Become the right user.
    • Run command with root user.
      • su <XYZ>
  • Start Splunk
    • /opt/splunkforwarder start

 

And then you should be able to do whatever you need with Splunk.

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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...