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

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...