Splunk Search

How can I add metadata to events at the forwarder?

rphillips_splk
Splunk Employee
Splunk Employee

I'd like to add metadata to my events at the source and change the _meta value periodically without restarting the forwarders.

0 Karma
1 Solution

rphillips_splk
Splunk Employee
Splunk Employee

forwarder:
inputs.conf
[monitor::///var/logs]
_meta = foo:bar

foo represents field name , bar represents field value

indexers:
fields.conf
[foo]
INDEXED = true

I also want to update the metadata value periodically without restarting Splunk on the forwarders.

$SPLUNK_HOME/bin
./splunk _internal call /services/data/inputs/monitor/_reload -auth admin:changeme

View solution in original post

rphillips_splk
Splunk Employee
Splunk Employee

forwarder:
inputs.conf
[monitor::///var/logs]
_meta = foo:bar

foo represents field name , bar represents field value

indexers:
fields.conf
[foo]
INDEXED = true

I also want to update the metadata value periodically without restarting Splunk on the forwarders.

$SPLUNK_HOME/bin
./splunk _internal call /services/data/inputs/monitor/_reload -auth admin:changeme

michaelissartel
Explorer

Hi @rphillips_splk where can I find the doc for commands like ./splunk _internal call /services/data/inputs/monitor/_reload -auth admin:changeme

Can I do a post whit it ?

0 Karma

michaelissartel
Explorer

Hi @rphillips_splk 

bar can be an environment variable ?

thanks

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

No. The only "variable" (runtime-determined) parts of the config are those explicitly defined as such in specs.

For example - serverName parameter in [general] section of server.conf. The specs say that it can contain environment variables so it can be dynamically set. For other parameters you define constant values.

rphillips_splk
Splunk Employee
Splunk Employee

@michaelissartel I haven't tested using an env variable as the field value before. If you do end up testing can you put your reply here for others?

michaelissartel
Explorer

Hi, this solution has been cancelled  😕

0 Karma

gravesb
Engager

In case anyone else runs across this, the proper syntax in the inputs.conf is
_meta = foo::bar
two colons between the key and value instead of one.

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!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...