Getting Data In

How to Identify which HF is sending logs/metrics

_pravin
Contributor

Hi,

I have incoming data from 2 Heavy Forwarders.

Both of forward HEC data and the internal logs, how do I identify which HF is sending a particular HEC data?

 

Regards,

Pravin

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @_pravin ,

I di this and it runs:

# cat props.conf 
[default]
TRANSFORMS-default = set_splunk_hf

# cat transforms.conf 
[set_splunk_hf]
INGEST_EVAL = splunk_hf := splunk_server

# cat fields.conf
[splunk_hf]
INDEXED = true

Ciao.

Giuseppe

PickleRick
SplunkTrust
SplunkTrust

Remember that := operator is worse performance-wise than simple =

Also since you're using TRANSFORM, not RULESET, it will only be fired once on non-parsed data so unless you already have an _indexed field_ called splunk_hf with your unparsed data (a very very unlikely scenario), you can just use normal assignment operator.

PickleRick
SplunkTrust
SplunkTrust

Unless you explicitly do something to the data (for example, add an indexed field containing the name of the forwarder) Splunk doesn't keep this kind of metadata.

0 Karma

_pravin
Contributor

I use Splunk Enterprise 9.0.4 and I tried adding _meta field which didn't work. I also tried adding INGEST_EVAL to transforms and tried sending the data, still no luck identifying the source.

0 Karma

marnall
Motivator

Can you post how your _meta field was configured? It should be in inputs.conf and have the format:

_meta = fieldname::fieldvalue

So if you have two heavy forwarders, one can have an input with:

_meta = meta_hfnum::1

and the other:

_meta = meta_hfnum::2

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Unfortunately, there is just one "instance" of _meta entry in the whole config. So you can't "merge" separate _meta settings - one will overwrite another. That's why TRANSFORMS is a better approach.

I'm also not sure what _meta will do on the splunktcp input especially when handling an input stream already containing metadata fields.

0 Karma

marnall
Motivator

You can have separate _meta entries for different input stanzas. If you have two heavy forwarders handing different inputs then this should be doable. I've not tried it in a generalized input stanza but if the number of input stanzas are low then it is feasible to add _meta entries for each.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Yes. For different input stanzas - sure. But you can't - for example - have multiple apps defining multiple meta entries (like one for the environment the forwarder is in and another for the OS or team responsible or whatever) for the same input.

0 Karma

dural_yyz
Motivator

I had done something like this in a previous life.  Each HF should get an app which has a props definition under the default stanza.  For a small number of HF's you can do this manually, for a large group to manage from like a DS reference the Splunk environment variables.

props.conf

[default]
splunk_forwarder = <HOSTNAME>

It has been a while so play around with this.  I seem to remember it was a props.conf mapped to transforms.conf which inserted the hostname so find what works the best for you. 

0 Karma

dural_yyz
Motivator

Ok, it's been a long time but I finally had a use case to reimplement this from scratch in a new environment.

props.conf

[default]
TRANSFORMS-splunk_forwarder = splunk_forwarder_field

transforms.conf

[splunk_forwarder_field]
REGEX = .
WRITE_META = true
FORMAT = splunk_forwarder::text_host_name_of_choice

Note: The literal text after the :: becomes the value.

 

Additional value is I can reverence this field in a tstats by command to group things together.  It's helpful in many ways but I like be able to track count of ingested event by HF source for index source and sourctypes.

PickleRick
SplunkTrust
SplunkTrust

And how is this supposed to work? There is no property called splunk_forwarder in any props stanza. Also, Splunk does variable expansion on a very limited set of settings.

0 Karma

hieuba6868
Explorer

you can check field call "splunk_server"

0 Karma

_pravin
Contributor

Hi @hieuba6868 ,

 

I am sending open telemetry data to heavy forwarder and the HF forwards the data to indexers. When I look at the  field 'splunk_server' I can see only the name of indexers. If I look at the data I can see the name of the otel source. In my current scenario I want to know which is the HF sending the data.

 

Regards,

Pravin

0 Karma

alemarzu
Motivator

Hi there, 

Not sure If you already did but the Monitoring Console could give you some insight. Mainly volume per token and activity by your HEC instances aka HFs.

Take a look under Indexing > Inputs > HTTP Event Collector: Instance

 

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...