<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it okay to run a universal forwarder without an inputs.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297847#M56367</link>
    <description>&lt;P&gt;-- Do I need an &lt;CODE&gt;inputs.conf&lt;/CODE&gt; that specifies the hostname?&lt;/P&gt;

&lt;P&gt;You don't need to explicitly specify the hostname - the forwarder runs &lt;CODE&gt;uname -a&lt;/CODE&gt; on Linux and a similar command on Windows to find out, by itself, the host name.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2017 21:10:00 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2017-08-22T21:10:00Z</dc:date>
    <item>
      <title>Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297842#M56362</link>
      <description>&lt;P&gt;I am the security guy and Splunk admin.  I am running 6.6.x universal forwarders on all my windows servers.  I just found out that the server admins are cloning boxes all willy-nilly.  When trying to figure out why SERVER05 wasn't reporting in, it was because its inputs.conf had "host = SERVER01".  I was getting my data, it was just hiding under the wrong host.&lt;/P&gt;

&lt;P&gt;Googling around I found the solution is to delete inputs.conf and server.conf, then restart the UF.  This seems to work.  The UF does recreate the server.conf, but not the inputs.conf.&lt;/P&gt;

&lt;P&gt;My question is, is this a problem?  All of my inputs are managed in apps via a deployment server.  Do I need an inputs.conf that specifies the hostname?  I can't see any problems right now but wanted to ask the community.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 19:39:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297842#M56362</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2017-08-22T19:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297843#M56363</link>
      <description>&lt;P&gt;You can easily create a new &lt;CODE&gt;inputs.conf&lt;/CODE&gt; under &lt;CODE&gt;/opt/splunk/etc/system/local&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So essentially you will have multiple &lt;CODE&gt;inputs.conf&lt;/CODE&gt;.. The one under &lt;CODE&gt;etc/system/local&lt;/CODE&gt; just defines the hostname so you can identify it &lt;/P&gt;

&lt;P&gt;Here's what it should look like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
host = &amp;lt;HOST-NAME&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Restart splunkd after making this change&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 19:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297843#M56363</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-08-22T19:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297844#M56364</link>
      <description>&lt;P&gt;You should work with your server admins and have them run &lt;CODE&gt;./splunk clone-prep-clear-config&lt;/CODE&gt; if they clone an existing forwarder installation, then restart it (&lt;A href="http://docs.splunk.com/Documentation/Forwarder/6.6.2/Forwarder/Makeauniversalforwarderpartofahostimage"&gt;Documentation&lt;/A&gt;). That will not only initialize host settings, but also generate a new GUID for the installation.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297844#M56364</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-08-22T20:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297845#M56365</link>
      <description>&lt;P&gt;Yes, absolutely.  That's the plan moving forward.  But I've got fix a few hundred machines in the mean time.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297845#M56365</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2017-08-22T20:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297846#M56366</link>
      <description>&lt;P&gt;True, but I've got to fix a few hundred machines.  I need something scriptable.  While I could do what you suggest, the real question is "do I need to."&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 20:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297846#M56366</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2017-08-22T20:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297847#M56367</link>
      <description>&lt;P&gt;-- Do I need an &lt;CODE&gt;inputs.conf&lt;/CODE&gt; that specifies the hostname?&lt;/P&gt;

&lt;P&gt;You don't need to explicitly specify the hostname - the forwarder runs &lt;CODE&gt;uname -a&lt;/CODE&gt; on Linux and a similar command on Windows to find out, by itself, the host name.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 21:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297847#M56367</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2017-08-22T21:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is it okay to run a universal forwarder without an inputs.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297848#M56368</link>
      <description>&lt;P&gt;I wanted to come back to this post to let everyone know that my solution works fine except for Stream.  I use Stream to collect DNS logs.  When i deleted inputs.conf and server.conf, the host came in as literal string"$decideatstartup".  All other event types works as advertised.&lt;/P&gt;

&lt;P&gt;Here's the script I wrote to clean up our environment.  I have it scheduled to run once a week.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$Date    = Get-Date -Format yyyyMMdd
$logFile = "c:\work\logs\cleanupSplunk-"+$Date+".log"

function logger{
    param ([string]$element, [string]$message)
    $string = "$(Get-Date); $($element); $($message)"
    Add-Content -path $logFile $string
}

function fix-Splunk{
    param( [string]$server )
    $clean = $true
    if(![System.IO.File]::Exists("\\$server\c$\Program Files\SplunkUniversalForwarder\bin\splunkd.exe")){
        logger $server "WARNING Splunk not found"
    } else {
        $splunkService = Get-Service -Computer $server -Name splunkforwarder
        if([System.IO.File]::Exists("\\$server\c$\Program Files\SplunkUniversalForwarder\etc\system\local\inputs.conf")){
            $clean = $false
            logger $server "INFO inputs.conf found"
            Remove-Item –path "\\$server\c$\Program Files\SplunkUniversalForwarder\etc\system\local\inputs.conf" -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            Remove-Item –path "\\$server\c$\Program Files\SplunkUniversalForwarder\etc\system\local\server.conf" -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            if ($ProcessError) {
                logger $server "ERROR deleting inputs.conf"
            } else {
                logger $server "INFO inputs.conf deleted"
            }
            Clear-Variable ProcessError
            Restart-Service -InputObject $splunkService -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            if ($ProcessError) {
                logger $server "ERROR restarting splunkforwarder"
            } else {
                logger $server "INFO splunkforwarder restarted"
            }
            Clear-Variable ProcessError
        }
        if([System.IO.File]::Exists("\\$server\c$\Program Files\SplunkUniversalForwarder\etc\system\local\deploymentclient.conf")){
            $clean = $false
            logger $server "deplymentclient found"
            Remove-Item –path "\\$server\c$\Program Files\SplunkUniversalForwarder\etc\system\local\deploymentclient.conf" -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            if ($ProcessError) {
                logger $server "ERROR deleting deplymentclient.conf"
            } else {
                logger $server "INFO deplymentclient.conf deleted"
            }
            Clear-Variable ProcessError
            Restart-Service -InputObject $splunkService -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            if ($ProcessError) {
                logger $server "ERROR restarting splunkforwarder"
            } else {
                logger $server "INFO splunkforwarder restarted"
            }
            Clear-Variable ProcessError
        }
        if ($splunkService.Status -eq "Stopped") {
            $clean = $false
            logger $server "WARNING Splunk service stopped"
            Start-Service $splunkService -ErrorAction SilentlyContinue -ErrorVariable ProcessError
            if ($ProcessError) {
                logger $server "ERROR starting splunkforwarder"
            } else {
                logger $server "INFO splunkforwarder started"
            }
            Clear-Variable ProcessError
        }
        if ($clean -eq $true) {
            logger $server "INFO server clean"
        }
    }
}

logger "-" "INFO Script Started"
Get-ADComputer -ResultPageSize 10000 -ResultSetSize $null -Filter { 
    (OperatingSystem -Like '*Windows*Server*') -and
    (enabled -eq $True)
    } -ErrorAction SilentlyContinue | where { ($_.DistinguishedName -notlike "*OU=Domain Controllers,*") } | select-object -expandproperty name | foreach-object {
    Write-Warning "Trying $_"
    if (test-connection -computername $_ -count 1 -quiet -ErrorAction SilentlyContinue) {
        fix-Splunk $_
    } else {
        logger $_ "ERROR cannot connect"
    }
}
logger "-" "INFO Script Finished"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Nov 2017 16:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-okay-to-run-a-universal-forwarder-without-an-inputs-conf/m-p/297848#M56368</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2017-11-18T16:03:57Z</dc:date>
    </item>
  </channel>
</rss>

