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
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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