Getting Data In

How would you manipulate the host name at index time based on serverclass?

Cuyose
Builder

What would a props/transform look like on an indexer that would append to the hostname field at index time based on the serverclass of the forwarder sending events?

If we are launching different serverclasses into specific interfaces, then setting the regex in the serverclass to mark those as "web servers" to push out deployment apps etc. What is the best practice if you don't want to actively manipulate the inputs host = stanza on the forwarders, to basically add a string in front of the auto reported IP for the host name that the forwarder assigns at index time?

0 Karma

woodcock
Esteemed Legend

You need to play around with server.conf:
I am pretty sure that if you deploy this setting BEFORE you start splunk the first time, it will initialize the way that you are asking:

serverName=web-$COMPUTERNAME

In any case, you can DEFINITELY edit the setting post-install in $SPLUNK_HOME/etc/system/local/server.conf and set it there and everything that that host sends in will be updated for all events (even the internal index=_* ones).

http://docs.splunk.com/Documentation/Splunk/latest/Admin/Serverconf

0 Karma

woodcock
Esteemed Legend

Do you really mean serverclass in your question? This is a highly unusual (and really impossible) request, at least if taken literally. If what you mean is to create a series of deployment apps, each of which maps to a specific serverclass, and each of which has a particular hostname override, then this is very doable and there is a ton of documentation on each of the 2 steps. Which step is giving you trouble?

0 Karma

Cuyose
Builder

I was overthinking it I believe, however I am a little confused over the last step.
Basically let the forwarder auto assign the hostname, which in our case would be the IP
It then phones home, where the deployment server maps its serverclass and pushes the assigned apps out.
In the inputs of those assigned apps we just set the host name.

If the auto assigned for example is 10.2.5.120, how would you go about creating a stanza that basically did this in the inputs sent out to that forwarder?

[default]
host = web-<auto assigned host>

for a host set in splunk for events coming from that server as host = web-10.2.5.120

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...