Installation

Splunk Universal forwarder should forward the data to a specific index of Splunk Indexer

sdhiren
Explorer

HI All, I want to forward the log data using Splunk Universal forwarder to a specific index of Splunk Indexer.
I am running UF and Splunk Indexer inside a docker container.

I am able to achieve this by modifying the inputs.conf file of UF after the container is started.

 

[monitor::///app/logs]
index = logs_data

 

But, after making this change, I have to RESTART my UF container. 

I want to ensure when my UF starts, it should send the data to "logs_data" index by default (assuming this index is present in the Splunk Indexer)

I tried overriding the default inputs.conf by mounting the locally created inputs.conf to its location

Below is the snippet of how I am creating the UF container

 

  splunkforwarder:
    image: splunk/universalforwarder:8.0
    hostname: splunkforwarder
    environment:
      - SPLUNK_START_ARGS=--accept-license --answer-yes
      - SPLUNK_STANDALONE_URL=splunk:9997
      - SPLUNK_ADD=monitor /app/logs
      - SPLUNK_PASSWORD=password
    restart: always
    depends_on:
      splunk:
        condition: service_healthy
    volumes:
      - ./inputs.conf:/opt/splunkforwarder/etc/system/local/inputs.conf

 

But, I am getting some weird error while container is trying to start.

 

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OSError: [Errno 16] Device or resource busy: b'/opt/splunkforwarder/etc/system/local/.ansible_tmpnskbxfddinputs.conf' -> b'/opt/splunkforwarder/etc/system/local/inputs.conf'
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Unable to make /home/splunk/.ansible/tmp/ansible-moduletmp-1710787997.6605148-qhnktiip/tmpvjrugxb1 into to /opt/splunkforwarder/etc/system/local/inputs.conf, failed final rename from b'/opt/splunkforwarder/etc/system/local/.ansible_tmpnskbxfddinputs.conf': [Errno 16] Device or resource busy: b'/opt/splunkforwarder/etc/system/local/.ansible_tmpnskbxfddinputs.conf' -> b'/opt/splunkforwarder/etc/system/local/inputs.conf'​

 

Looks like, some process is trying to access the inputs.conf while its getting overridden. 

Can someone please help me solve this issue?
 
Thanks
Labels (2)
Tags (1)
0 Karma

KendallW
Contributor

Are you able to check which process is using the inputs.conf file with lsof?
You may need to stop Splunk, update the file, then start Splunk again. 



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!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...