Archive
Highlighted

Adding domain name to hostnames

Explorer

I have multiple LightForwarded, in different domains, who have similar host names (machines inside one domain are the same as machines in another domain),

how can i configure each splunk LightForwarder to add the domain name of any event it sends to the Central splunk ?

Tags (1)
Highlighted

Re: Adding domain name to hostnames

Motivator

You can edit the hostname assigned to events from a host by editing the host= value in your $SPLUNK_HOME/etc/system/local/inputs.conf. Just change it from

host=hostname

to

host=hostname.domain.com
Highlighted

Re: Adding domain name to hostnames

Explorer

this will change the local events, but events from the syslog, for example, will not be changed by this, which is fine, as they might come from other machines in the same domain.

so, i want to add .something.com to all hostname evetns, is that possible somehow ?

0 Karma
Highlighted

Re: Adding domain name to hostnames

Motivator

I'm sorry, but i'm not sure what you're trying to get at here. Your question indicated you're using a forwarder setup rather than syslog. How are you sending your syslog to splunk? Via a direct network input in splunk or via syslog-ng and then indexing the resulting logs?

0 Karma
Highlighted

Re: Adding domain name to hostnames

Explorer

syslog has info from local and remove machines

the *nix app is fixed by host= entry
but, the same host writes things to syslog,and other nodes writes to syslog through syslogd, these entires dont have the domaine, for example,

Aug 12 14:20:06 xen00 last message repeated 3 times
this doesnt have the domain name, so the same machine, from different SplunkLightForwarders in different locations will be indexed under the same hostname.

i want splunk in each location to add a domain name to the hostname it sees in syslog.

0 Karma
Highlighted

Re: Adding domain name to hostnames

Explorer

just to be clear, *nix is parsing /var/log/syslog

0 Karma
Highlighted

Re: Adding domain name to hostnames

Super Champion

Splunk has a transformer that extracts "host" from syslog sourcetypes, and that will override any given host=myhostname that you setup in inputs.conf. Just for the record, I do think setting your hostname in this way is also a good idea, but I suggest doing so at the top of system/local/inputs.conf (as ftk suggests) rather than in the unix app--this way the setting is fully global and not limited to a single app context.

0 Karma
Highlighted

Re: Adding domain name to hostnames

Super Champion

I recommend using a transformer for adding a static domain name to your host field. I've previously posted some config examples (linke below) that works for the syslog (and various derived) sourcetypes. The example shown is smart enough not to accidentally append your domain to an IP address.

Please see my answer here:

0 Karma
Highlighted

Re: Adding domain name to hostnames

Explorer

will this work on a LightForwarder ?

0 Karma
Highlighted

Re: Adding domain name to hostnames

Super Champion

I'm not 100% sure, you can try it. Worst case scenario is that you have to put it on the indexer. I think this also depends on your Splunk version, I think 4.0 does more on light forwarder than was handled by the 3.x light forwarders.

0 Karma