Getting Data In

Adding statis field at index time

bkonurbayev
New Member

Hi,

I need to add extra field at index time.
The field is "Name of DEV/QA/Prod environment", which never changes during its hosts life-cycle.
What would be the best way to do that?
I don't want to do that at search time, because

  1. it is something that needs to be for all sources.
  2. it is static

According to Splunk Doc, its not recommended:

Caution: Do not add custom fields to the set of default fields that Splunk software automatically extracts and indexes at index time unless absolutely necessary.

Please, advise if there are any ideas.

Thanks.

0 Karma

woodcock
Esteemed Legend

I agree with Splunk. If I were you, I would do an automatic lookup only for the sourcetype(s) that need to map the host to it's particular key/value pair for this information. This way, you are not clogging your disk space with static data that is the same for every event.

0 Karma

adonio
Ultra Champion

if you really must, you can do it ...
however, there are many other ways
for example, have the source field have the required environment or create a unique index for each environment data, as if its the same data and carries same sourcetype, you can always search all and split by sourcetype for example.
another option, as you mentioned is in search time, tags are a good candidate for that kind of job

hope it helps

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 ...