Installation

Is there a way to clear down the config of an installed UF and then point it to the distribution server for new configs?

anapp
Explorer

Hi All

I need a way to clear down the config of an installed UF and then point it to the distribution server and pick up new/refreshed configs

Apart from uninstalling, removing files and re-installing the UF is there a clever way of doing this

(background, we've a number of hosts reporting in as the wrong hostname, and want to sort them out)

Cheers

 

Al

Labels (2)
0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@anapp - Write a shell script for Linux/Unix devices and CMD/PowerShell scripts for Windows devices.

  • Create a custom App on current deployment server.
  • Write this script as Splunk scripted input. 
  • What does this script do:
    • Update the configuration file to point to the new deployment server.
    • Splunk Restart.
      • Because your script is running as a child process of Splunk it cannot restart Splunk successfully.
      • So you need to run it under the wrapper script. Here is an example to start with:

 

#!/bin/bash

SCRIPT=`/usr/bin/realpath $0`
SCRIPTPATH=`/usr/bin/dirname $SCRIPT`
echo "Executing $SCRIPTPATH/my_script.sh $SPLUNK_HOME" >&2
(exec /usr/bin/setsid /usr/bin/sh $SCRIPTPATH/my_script.sh $SPLUNK_HOME &)

 

  • And then use wrapper script as Scripted input.
  • Make sure to keep the new configuration ready on the new deployment server beforehand.

 

Kindly upvote if this helps!!!

anapp
Explorer

thanks - useful but not quite what I need, I should have been more specific 🙂

We seem to have some servers built from a template whereby they are "reporting in" as the wrong servername.  I assumed I could correct the local\server.conf to correct this but that doesn't seem to fix the issue.

So I'm looking for as general as possible "wipe" of local config so it only knows the deployment server and starts afresh

0 Karma

richgalloway
SplunkTrust
SplunkTrust

When you created the template did you run splunk clone-prep-clear-config first?  That command removes the unique identifiers for the UF so it can be replicated to multiple target systems.  See https://docs.splunk.com/Documentation/Splunk/9.0.4/Admin/Integrateauniversalforwarderontoasystemimag...

---
If this reply helps you, Karma would be appreciated.

anapp
Explorer

let's just say the team responsible do that _now_ 🙂

0 Karma
Get Updates on the Splunk Community!

Infographic provides the TL;DR for the 2024 Splunk Career Impact Report

We’ve been buzzing with excitement about the recent validation of Splunk Education! The 2024 Splunk Career ...

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...