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
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...