Getting Data In

Heartbeat for forwarder

sdevadas
Path Finder

Hi,

I am trying to setup a heartbeat to know if our Splunk forwarders are working fine.
From this forum, I found I can easily query for forwarders which have been quiet while eliminating very old (say retired) forwarders.
e.g., query for forwarders which have been quiet for 1 hour upto a max of 1 day:
| metadata type=hosts | eval age = now() - lastTime | search (age > 3600 AND age < 86400) | sort age d | convert ctime(lastTime) | fields age, host, lastTime

I would like to now setup a heartbeat event from the forwarder. Is this possible using Splunk forwarder configuration?
I saw the sendCookedData and heartbeatFrequency settings for outputs.conf of a forwarder.
e.g.:
sendCookedData = true
heartbeatFrequency = 30

Haven't tested this out yet but, will these settings actually send an event every 30 seconds to the indexer, so that the search given before will omit such forwarders even if they are not emitting any other events?
If this works, are there any other side effects of these settings, which I should be aware of?

If this does not work and the heartbeat does not generate any events, is there any way I can generate heartbeat events from within the Splunk forwarder?

Thanks

Tags (2)
0 Karma

sdevadas
Path Finder

gkanapathy, Thanks again. Here's the search I ended up alerting on:

| set diff [search earliest="-30m" index=_internal host="MYINDEXERS*" source="/opt/splunk/var/log/splunk/metrics.log" | dedup hostname | table hostname] [search earliest="-10m" index=_internal host="MYINDEXERS*" source="/opt/splunk/var/log/splunk/metrics.log" | dedup hostname | table hostname]

rmorlen
Splunk Employee
Splunk Employee

I tried this but it didn't work for me. (Running Splunk 4.x). Substituted MYINDEXERS with our indexer and use "*metrics*" instead of what you have. Still didn't work.

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

The Splunk indexers already report on every forwarder connection every 30 seconds in the internal metrics log.

if you really want, the forwarders themselves also write into their own log internal metrics logs every 30 seconds at least. These, however, are by default not forwarded as of most recent versions of Splunk.

sdevadas
Path Finder

Thanks, this is helpful. I had turned off the indexer logs indexing in all envs, will to turn it on and test it out in QA environment.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...